/// <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));
 }
 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);
 }
 public TimerImplementation BuildTimer(string name, Unit unit, TimeUnit rateUnit, TimeUnit durationUnit, HistogramImplementation histogram)
 {
     return new TimerMetric(histogram);
 }