public static HistogramValueSource FromSerializableMetric(this HistogramMetric source)
        {
            var histogramValue = new HistogramValue(
                source.Count,
                source.LastValue,
                source.LastUserValue,
                source.Max,
                source.MaxUserValue,
                source.Mean,
                source.Min,
                source.MinUserValue,
                source.StdDev,
                source.Median,
                source.Percentile75,
                source.Percentile95,
                source.Percentile98,
                source.Percentile99,
                source.Percentile999,
                source.SampleSize);

            return(new HistogramValueSource(
                       source.Name,
                       source.Group,
                       ConstantValue.Provider(histogramValue),
                       source.Unit,
                       source.Tags.FromDictionary()));
        }
コード例 #2
0
        /// <inheritdoc />
        public HistogramValue GetValue(bool resetMetric = false)
        {
            var value = new HistogramValue(_last.Value, _last.UserValue, _reservoir.Value.GetSnapshot(resetMetric));

            if (resetMetric)
            {
                _last = UserValueWrapper.Empty;
            }

            return(value);
        }
コード例 #3
0
        public static HistogramValueSource ToMetricValueSource(this HistogramMetric source)
        {
            var histogramValue = new HistogramValue(
                source.Count,
                source.LastValue,
                source.LastUserValue,
                source.Max,
                source.MaxUserValue,
                source.Mean,
                source.Min,
                source.MinUserValue,
                source.StdDev,
                source.Median,
                source.Percentile75,
                source.Percentile95,
                source.Percentile98,
                source.Percentile99,
                source.Percentile999,
                source.SampleSize);

            return(new HistogramValueSource(source.Name, ConstantValue.Provider(histogramValue), source.Unit, source.Tags));
        }