Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • The histogram is defined on line 3 (using the interface type)

  • The InitializeMetrics() method is called (automatically) after the device is loaded (after the Load method). Any labels used within the InitializeMetrics() method must be initialized in your constructor or Load methods.

  • The histogram is created in the InitializeMetrics method.

  • The operation to be measured is wrapped with the .NewTimer() method. The NewTimer method is a specialized function of the histogram type for measuring duration (in seconds). Other operations (like size) are measured using the .Observe(X) method.

Info

The InitializeMetrics method is called by the base class any time a user changes the metrics configuration. By initializing your metrics in this override, your Your metric(s) will automatically enable and disable be enabled and disabled (when users change the metric configuration) without requiring a service restart.

...