Beispiel #1
0
 protected TimerMetricBase(TimeUnit durationUnit, TimeUnit rateUnit, MeterMetric meter, HistogramMetric histogram, bool clear)
 {
     DurationUnit = durationUnit;
     RateUnit     = rateUnit;
     Meter        = meter;
     Histogram    = histogram;
     if (clear)
     {
         Clear();
     }
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 protected TimerMetricBase(TimeUnit durationUnit, TimeUnit rateUnit) : this(durationUnit, rateUnit, MeterMetric.New("calls", rateUnit), new HistogramMetric(HistogramMetric.SampleType.Biased), clear : true)
 {
 }
Beispiel #4
0
 private TimerMetric(TimeUnit durationUnit, TimeUnit rateUnit, MeterMetric meter, HistogramMetric histogram, bool clear) : base(durationUnit, rateUnit, meter, histogram, clear)
 {
 }