protected TimerMetricBase(TimeUnit durationUnit, TimeUnit rateUnit, MeterMetric meter, HistogramMetric histogram, bool clear) { DurationUnit = durationUnit; RateUnit = rateUnit; Meter = meter; Histogram = histogram; if (clear) { Clear(); } }
public static MeterMetric New(string eventType, TimeUnit rateUnit, IDateTimeOffsetProvider dateTimeOffsetProvider = null) { var meter = new MeterMetric(eventType, rateUnit, dateTimeOffsetProvider); Task.Run(async() => { while (!meter._token.IsCancellationRequested) { await Task.Delay(Interval, meter._token.Token); meter.Tick(); } }, meter._token.Token); return(meter); }
protected TimerMetricBase(TimeUnit durationUnit, TimeUnit rateUnit) : this(durationUnit, rateUnit, MeterMetric.New("calls", rateUnit), new HistogramMetric(HistogramMetric.SampleType.Biased), clear : true) { }
private TimerMetric(TimeUnit durationUnit, TimeUnit rateUnit, MeterMetric meter, HistogramMetric histogram, bool clear) : base(durationUnit, rateUnit, meter, histogram, clear) { }