Exampple.Router.Task.Monitor (exampple v0.9.1)
The monitor starts a task to attend the incoming request, when the task is launched a timer is set. The timer is cancelled when the task is terminated. If the task crashes, the monitor receives a message and replies with an error. In case of timeout the request is returning a timeout and the task is terminated.
In addition to the logs regarding the stanzas we have the following information to be gathered by telemetry:
[:xmpp, :request, :success]
[:xmpp, :request, :failure]
[:xmpp, :request, :timeout]
All of them register
duration in milliseconds so, you can get
the maximum, minimum, average, percentile and more statistics from
the duration of the stanzas inside of the system based on if they
are correct (success), wrong (failure) or was not attended (timeout).
Link to this section Summary
Returns a specification to start this module under a supervisor.
Starts the monitor as a server passing the stanza in
domain for the component and the name of the application
otp_app) and the
timeout, all of those parameters as a