Ejemplo n.º 1
0
 internal TimerMetric(MetricName metricName, TimeUnit durationUnit) : this(durationUnit, TimeUnit.Seconds,
                                                                           MeterMetric.New(metricName, "updates", TimeUnit.Seconds),
                                                                           new HistogramMetric(metricName, SampleType.Biased), true)
 {
     Name = metricName;
 }
Ejemplo n.º 2
0
 internal CounterMetric(MetricName metricName)
 {
     Name = metricName;
 }
Ejemplo n.º 3
0
 private CounterMetric(MetricName metricName, AtomicLong count)
 {
     Name   = metricName;
     _count = count;
 }
Ejemplo n.º 4
0
        /// <summary>
        ///     Creates a new gauge metric and registers it under the given type and name
        /// </summary>
        /// <typeparam name="T">The type the gauge measures</typeparam>
        /// <param name="owner">The type that owns the metric</param>
        /// <param name="name">The metric name</param>
        /// <param name="evaluator">The gauge evaluation function</param>
        /// <returns></returns>
        public GaugeMetric <T> Gauge <T>(Type owner, string name, Func <T> evaluator)
        {
            var metricName = new MetricName(owner, name);

            return(GetOrAdd(metricName, new GaugeMetric <T>(metricName, evaluator)));
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     Creates a new counter metric and registers it under the given type and name
        /// </summary>
        /// <param name="owner">The type that owns the metric</param>
        /// <param name="name">The metric name</param>
        /// <returns></returns>
        public CounterMetric Counter(Type owner, string name)
        {
            var metricName = new MetricName(owner, name);

            return(GetOrAdd(metricName, new CounterMetric(metricName)));
        }
Ejemplo n.º 6
0
 public bool TryGetMetric(MetricName name, out IMetric metric)
 {
     return(_store.TryGetValue(name, out metric));
 }
Ejemplo n.º 7
0
        /// <summary>
        ///     Creates a new histogram metric and registers it under the given type and name
        /// </summary>
        /// <param name="owner">The type that owns the metric</param>
        /// <param name="name">The metric name</param>
        /// <param name="sampleType">The sample type</param>
        /// <returns></returns>
        public HistogramMetric Histogram(Type owner, string name, SampleType sampleType)
        {
            var metricName = new MetricName(owner, name);

            return(GetOrAdd(metricName, new HistogramMetric(metricName, sampleType)));
        }
Ejemplo n.º 8
0
 private MeterMetric(MetricName metricName, string eventType, TimeUnit rateUnit)
 {
     Name      = metricName;
     EventType = eventType;
     RateUnit  = rateUnit;
 }
Ejemplo n.º 9
0
 /// <summary>
 ///     Creates a new <see cref="HistogramMetric" /> with the given sample
 /// </summary>
 internal HistogramMetric(MetricName metricName, ISample sample) : this(metricName, sample, true)
 {
     _sample = sample;
     Clear();
 }
Ejemplo n.º 10
0
 /// <summary>
 ///     Creates a new <see cref="T:BetterAPI.Metrics.HistogramMetric" /> with the given sample type
 /// </summary>
 internal HistogramMetric(MetricName metricName, SampleType type) : this(metricName, NewSample(type))
 {
 }