View Source exometer_proc (exometer_core v1.7.1)
Utility functions for the exometer_proc
probe type.
The exometer_proc
probe type is a vanilla Erlang process. All messages must be handled explicitly.
exometer_spiral
). When the exometer_proc
type is specified explicitly, the process is started automatically, and the following messages: lang="erlang"
{exometer_proc, {update, Value}}
{exometer_proc, sample}
{exometer_proc, reset}
{exometer_proc, {Pid,Ref}, {get_value, Datapoints}} -> {Ref, Reply}
{exometer_proc, {Pid,Ref}, {setopts, Opts}} -> {Ref, Reply}
{exometer_proc, stop}
Summary
Functions
Make a synchronous call to an exometer_proc
process.
Send an asynchronous message to an exometer_proc
process.
Apply process_flag-specific options.
Spawn an exometer_proc
process.
Terminate probe process in an orderly way.
Functions
Make a synchronous call to an exometer_proc
process.
receive
clause and respond properly. The protocol is: lang="erlang"
call(Pid, Req) ->
MRef = erlang:monitor(process, Pid),
Pid ! {exometer_proc, {self(), MRef}, Req},
receive
{MRef, Reply} -> Reply
after 5000 -> error(timeout)
end.
Send an asynchronous message to an exometer_proc
process.
{exometer_proc, Msg}
to the given process.
-spec spawn_process(exometer:name(), fun(() -> no_return())) -> pid().
Spawn an exometer_proc
process.
F
which needs to initialize the probe and enter an event loop. (Note: exometer_proc
processes are responsible for their own event loop).
-spec stop() -> no_return().
Terminate probe process in an orderly way.
This function doesn't return.