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)); }
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)); }