This commit is contained in:
2020-05-26 15:40:32 +00:00
parent 0c2b226e79
commit e511667dbc

View File

@@ -89,20 +89,23 @@ namespace AyaNova.Api.Controllers
if (maxRecords < MinuteMetrics.Count)
{
cpu=Util.DataUtil.LargestTriangleThreeBuckets(cpu,(int)maxRecords) as List<Tuple<double, double>>;
cpu = Util.DataUtil.LargestTriangleThreeBuckets(cpu, (int)maxRecords) as List<Tuple<double, double>>;
//downsample it here
;//https://github.com/sveinn-steinarsson/flot-downsample/
}
//convert to efficient array of double pairs
var v=cpu.Select(z=> new double[]{z.Item1,z.Item2}).ToArray();
//convert to efficient array of double pairs
var v = cpu.Select(z => new double[] { z.Item1, z.Item2 }).ToArray();
var ret = new
{
cpu = v
};
//Log
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.Metrics, AyaEvent.Retrieved), ct);
return Ok(ApiOkResponse.Response(v));
return Ok(ApiOkResponse.Response(ret));
}