예제 #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();
     }
 }
예제 #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);
        }
예제 #3
0
 protected TimerMetricBase(TimeUnit durationUnit, TimeUnit rateUnit) : this(durationUnit, rateUnit, MeterMetric.New("calls", rateUnit), new HistogramMetric(HistogramMetric.SampleType.Biased), clear : true)
 {
 }
예제 #4
0
 private TimerMetric(TimeUnit durationUnit, TimeUnit rateUnit, MeterMetric meter, HistogramMetric histogram, bool clear) : base(durationUnit, rateUnit, meter, histogram, clear)
 {
 }