/// <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))); }
/// <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))); }
/// <summary> /// Return the <see cref="Core.Counter"/> registered under this name; or create and register /// a new <see cref="Core.Counter"/> if none is registered. /// </summary> /// <param name="name">The metric name</param> /// <returns>a new or pre-existing <see cref="Core.Counter"/></returns> public Counter Counter(MetricName name) { return(GetOrAdd(name, new Counter())); }
/// <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))); }
private CounterMetric(MetricName metricName, AtomicLong count) { Name = metricName; _count = count; }
/// <summary> /// Return the <see cref="Core.Counter"/> registered under this name; or create and register /// a new <see cref="Core.Counter"/> if none is registered. /// </summary> /// <param name="name">The metric name</param> /// <returns>a new or pre-existing <see cref="Core.Counter"/></returns> public Counter Counter(string name) { return(Counter(MetricName.build(name))); }
/// <summary> /// Return the <see cref="Core.Timer"/> registered under this name; or create and register /// a new <see cref="Core.Timer"/> if none is registered. /// </summary> /// <param name="name">The metric name</param> /// <returns>a new or pre-existing <see cref="Core.Timer"/></returns> public Timer Timer(MetricName name) { return(GetOrAdd(name, new Core.Timer())); }
internal TimerMetric(MetricName metricName, TimeUnit durationUnit) : this(durationUnit, TimeUnit.Seconds, MeterMetric.New(metricName, "updates", TimeUnit.Seconds), new HistogramMetric(metricName, SampleType.Biased), true) { Name = metricName; }
/// <summary> /// Return the <see cref="Core.Meter"/> registered under this name; or create and register /// a new <see cref="Core.Meter"/> if none is registered. /// </summary> /// <param name="name">The metric name</param> /// <returns>a new or pre-existing <see cref="Core.Meter"/></returns> public Meter Meter(MetricName name) { return(GetOrAdd(name, new Meter())); }
/// <summary> /// Return the <see cref="Core.Timer"/> registered under this name; or create and register /// a new <see cref="Core.Timer"/> if none is registered. /// </summary> /// <param name="name">The metric name</param> /// <returns>a new or pre-existing <see cref="Core.Timer"/></returns> public Timer Timer(String name) { return(Timer(MetricName.build(name))); }
/// <summary> /// Return the <see cref="Core.Meter"/> registered under this name; or create and register /// a new <see cref="Core.Meter"/> if none is registered. /// </summary> /// <param name="name">The metric name</param> /// <returns>a new or pre-existing <see cref="Core.Meter"/></returns> public Meter Meter(string name) { return(Meter(MetricName.build(name))); }
/// <summary> /// Return the <see cref="Core.Histogram"/> registered under this name; or create and register /// a new <see cref="Core.Histogram"/> if none is registered. /// </summary> /// <param name="name">The metric name</param> /// <returns>a new or pre-existing <see cref="Core.Histogram"/></returns> public Histogram Histogram(MetricName name) { return(GetOrAdd(name, new Histogram(new ExponentiallyDecayingReservoir()))); }
/// <summary> /// Return the <see cref="Core.Histogram"/> registered under this name; or create and register /// a new <see cref="Core.Histogram"/> if none is registered. /// </summary> /// <param name="name">The metric name</param> /// <returns>a new or pre-existing <see cref="Core.Histogram"/></returns> public Histogram Histogram(string name) { return(Histogram(MetricName.build(name))); }
/// <summary> /// Creates a new <see cref="T:Metrics.HistogramMetric" /> with the given sample type /// </summary> internal HistogramMetric(MetricName metricName, SampleType type) : this(metricName, NewSample(type)) { }
/// <summary> /// Return the <see cref="Core.Gauge"/> registered under this name; or create and register /// a new <see cref="Core.Gauge"/> if none is registered. /// </summary> /// <param name="name">The metric name</param> /// <param name="evaluator">The evaluator for the gauge</param> /// <returns>a new or pre-existing <see cref="Core.Gauge"/></returns> public Gauge <T> Gauge <T>(MetricName name, Func <T> evaluator) { return(GetOrAdd(name, new Gauge <T>(evaluator))); }
/// <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(); }
/// <summary> /// Given an <see cref="IMetric"/>, registers it under the given name /// </summary> /// <typeparam name="T">the type of the metric</typeparam> /// <param name="name">the name of the metric</param> /// <param name="metric">the metric</param> /// <returns><see cref="IMetric"/></returns> public T Register <T>(string name, T metric) where T : IMetric { return(Register(MetricName.build(name), metric)); }
private MeterMetric(MetricName metricName, string eventType, TimeUnit rateUnit) { Name = metricName; EventType = eventType; RateUnit = rateUnit; }
internal CounterMetric(MetricName metricName) { Name = metricName; }