/// <summary>
        /// Histogram represents an aggregated counter on the stream of values. It can calculate min, mean, max and stdDeviation.
        /// </summary>
        /// <param name="telemetryClient">Telemetry client to associate the meter with.</param>
        /// <param name="name">Name of the histogram.</param>
        /// <param name="aggregations">Types of aggregations to perform.</param>
        /// <returns>Returns a histogram implementation.</returns>
        public static IHistogram Histogram(this TelemetryClient telemetryClient, string name, HistogramAggregations aggregations = HistogramAggregations.Mean | HistogramAggregations.MinMax)
        {
            var histogram = new HistogramImplementation(name, telemetryClient.Context, aggregations);

            var configuration = GetConfigurationFromClient(telemetryClient);
            configuration.RegisterCounter(histogram);

            return histogram;
        }
コード例 #2
0
 public TimerImplementation BuildTimer(string name, Unit unit, TimeUnit rateUnit, TimeUnit durationUnit, HistogramImplementation histogram)
 {
     return(new TimerMetric(new HistogramMetric(new UniformReservoir()), new MeterMetric(this.clock, this.scheduler), this.clock));
 }
コード例 #3
0
 public TimerMetric(HistogramImplementation histogram, MeterImplementation meter, Clock clock)
 {
     this.clock     = clock;
     this.meter     = meter;
     this.histogram = histogram;
 }
コード例 #4
0
 public TimerMetric(HistogramImplementation histogram)
     : this(histogram, new MeterMetric(), Clock.Default)
 {
 }
コード例 #5
0
 public TimerImplementation BuildTimer(string name, Unit unit, TimeUnit rateUnit, TimeUnit durationUnit, HistogramImplementation histogram)
 {
     return(new TimerMetric(histogram));
 }
コード例 #6
0
 public TimerImplementation BuildTimer(string name, Unit unit, TimeUnit rateUnit, TimeUnit durationUnit, HistogramImplementation histogram)
 {
     return new TimerMetric(new HistogramMetric(new ExponentiallyDecayingReservoir(this.clock, this.scheduler)), new MeterMetric(this.clock, this.scheduler), this.clock);
 }
コード例 #7
0
 public TimerImplementation BuildTimer(string name, Unit unit, TimeUnit rateUnit, TimeUnit durationUnit, HistogramImplementation histogram)
 {
     return new TimerMetric(histogram);
 }