You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DefaultMetricsProvider accessible from MetricsRoot doesn't expose HistogramBuckets. This prevents the 'Reset()' operation to be used for HistogramBuckets much like the other metric types.
Here is an example of a gauge being updated then reset. The measurement options are exposed using the Measure property and the 'Reset()' function is exposed through the provider.
var _gaugeOptions = new App.Metrics.Gauge.GaugeOptions
{
Context = 'app',
Name = 'my_gauge'
};
_root.Measure.Gauge.SetValue(_gaugeOptions, 10);
...
_root.Provider.Gauge.Instance(_gaugeOptions).Reset();
In the example of the BucketHistogram, the provider doesn't have an option to reset the object in the registry.
var histogramOptions = new App.Metrics.BucketHistogram.BucketHistogramOptions
{
Context = 'app',
Name = 'my_histogram',
Buckets = new List<double> { 1, 10, 100, 1000, 2000, 5000 }
};
_root.Measure.BucketHistogram.Update(_histogramOptions, 100);
_root.Measure.BucketHistogram.Update(_histogramOptions, 5555);
...
// this option doesn't exist!
_root.Provider.BucketHistogram.Instance(_histogramOptions).Reset();
The IBucketHistogram is a IResetableMetric so it seems like this should be a legal operation.
Thanks!
The text was updated successfully, but these errors were encountered:
The DefaultMetricsProvider accessible from MetricsRoot doesn't expose HistogramBuckets. This prevents the 'Reset()' operation to be used for HistogramBuckets much like the other metric types.
https://github.com/AppMetrics/AppMetrics/blob/main/src/Core/src/App.Metrics.Core/Internal/DefaultMetricsProvider.cs
.. doesn't have HistogramBuckets
Here is an example of a gauge being updated then reset. The measurement options are exposed using the Measure property and the 'Reset()' function is exposed through the provider.
In the example of the BucketHistogram, the provider doesn't have an option to reset the object in the registry.
The IBucketHistogram is a IResetableMetric so it seems like this should be a legal operation.
Thanks!
The text was updated successfully, but these errors were encountered: