This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user