コード例 #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)
 {
 }