mirror of
https://github.com/codex-storage/cs-codex-dist-tests.git
synced 2025-02-02 15:23:29 +00:00
Fixes incorrect float formatting in metricsquery.
This commit is contained in:
parent
9461968bd3
commit
8ef190baad
@ -123,7 +123,7 @@ namespace MetricsPlugin
|
|||||||
{
|
{
|
||||||
if (values != null && values.Length > 0)
|
if (values != null && values.Length > 0)
|
||||||
{
|
{
|
||||||
return values.Select(v => MapValue(v)).ToArray();
|
return values.Select(MapValue).ToArray();
|
||||||
}
|
}
|
||||||
return Array.Empty<MetricsSetValue>();
|
return Array.Empty<MetricsSetValue>();
|
||||||
}
|
}
|
||||||
@ -155,9 +155,16 @@ namespace MetricsPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
private double ToValue(object v)
|
private double ToValue(object v)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
return Convert.ToDouble(v, CultureInfo.InvariantCulture);
|
return Convert.ToDouble(v, CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return double.NaN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private DateTime ToTimestamp(object v)
|
private DateTime ToTimestamp(object v)
|
||||||
{
|
{
|
||||||
@ -215,7 +222,7 @@ namespace MetricsPlugin
|
|||||||
{
|
{
|
||||||
var value = set.Values.SingleOrDefault(v => v.Timestamp == ts);
|
var value = set.Values.SingleOrDefault(v => v.Timestamp == ts);
|
||||||
if (value == null) e.Add(" ");
|
if (value == null) e.Add(" ");
|
||||||
else e.Add(value.Value.ToString());
|
else e.Add(value.Value.ToString(CultureInfo.InvariantCulture));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user