MeterListener
The MeterListener is class used to listen to the metrics instrument measurements recording.
Gets or sets the callback to get notified when an instrument is published.
Gets or sets the callback to get notified when the measurement is stopped on some instrument.
This can happen when the Meter or the Listener is disposed or calling Dispose on the listener.
public MeterListener()
Initializes a new instance of the MeterListener class.
Stops listening to a specific instrument measurement recording.
Disposes the listeners which will stop it from listening to any instrument.
Starts listening to a specific instrument measurement recording.
Calls all Observable instruments that the listener is listening to, and calls SetMeasurementEventCallback<T> with every collected measurement.
public void SetMeasurementEventCallback<T>(MeasurementCallback<T> measurementCallback) where T : struct
Sets a callback for a specific numeric type to get the measurement recording notification from all instruments which enabled listening and was created with the same specified numeric type.
If a measurement of type T is recorded and a callback of type T is registered, that callback will be used.
Enables the listener to start listening to instruments measurement recording.