예제 #1
0
        public static GaugeValueSource FromSerializableMetric(this GaugeMetric source)
        {
            var tags = source.Tags.FromDictionary();

            return(source.Value.HasValue
                ? new GaugeValueSource(source.Name, ConstantValue.Provider(source.Value.Value), source.Unit, tags)
                : new GaugeValueSource(source.Name, null, source.Unit, tags));
        }
예제 #2
0
 public static GaugeValueSource ToMetricValueSource(this GaugeMetric source)
 {
     return(source.Value.HasValue
         ? new GaugeValueSource(source.Name, ConstantValue.Provider(source.Value.Value), source.Unit, source.Tags)
         : new GaugeValueSource(source.Name, null, source.Unit, source.Tags));
 }