This commit is contained in:
@@ -49,37 +49,37 @@ namespace AyaNova.Api.Controllers
|
||||
serverState = apiServerState;
|
||||
}
|
||||
|
||||
#if (DEBUG)
|
||||
[HttpGet("collect")]
|
||||
[AllowAnonymous]
|
||||
public ActionResult GetCollect()
|
||||
{
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
GC.Collect();
|
||||
// #if (DEBUG)
|
||||
// [HttpGet("collect")]
|
||||
// [AllowAnonymous]
|
||||
// public ActionResult GetCollect()
|
||||
// {
|
||||
// GC.Collect();
|
||||
// GC.WaitForPendingFinalizers();
|
||||
// GC.Collect();
|
||||
|
||||
return Ok();
|
||||
}
|
||||
// return Ok();
|
||||
// }
|
||||
|
||||
|
||||
[HttpGet("hammer")]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> GetHammer()
|
||||
{
|
||||
//test allocation and cleanup
|
||||
for (int x = 0; x < 100000; x++)
|
||||
{
|
||||
AyContext ct = AyaNova.Util.ServiceProviderProvider.DBContext;
|
||||
var v=await ct.Widget.Where(z=>z.Serial<100).ToListAsync();
|
||||
// int i = await ct.Database.ExecuteSqlRawAsync($"select * from aglobalbizsettings");
|
||||
}
|
||||
// [HttpGet("hammer")]
|
||||
// [AllowAnonymous]
|
||||
// public async Task<IActionResult> GetHammer()
|
||||
// {
|
||||
// //test allocation and cleanup
|
||||
// for (int x = 0; x < 100000; x++)
|
||||
// {
|
||||
// AyContext ct = AyaNova.Util.ServiceProviderProvider.DBContext;
|
||||
// var v=await ct.Widget.Where(z=>z.Serial<100).ToListAsync();
|
||||
// // int i = await ct.Database.ExecuteSqlRawAsync($"select * from aglobalbizsettings");
|
||||
// }
|
||||
|
||||
return Ok();
|
||||
}
|
||||
// return Ok();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
// #endif
|
||||
|
||||
/// <summary>
|
||||
/// Get Memory and CPU server metrics for time period specified
|
||||
@@ -118,22 +118,10 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
var dsPrivateBytes = MinuteMetrics.Select(z => new Tuple<double, double>(z.t.ToOADate(), z.PrivateBytes)).ToList();
|
||||
dsPrivateBytes = Util.DataUtil.LargestTriangleThreeBuckets(dsPrivateBytes, (int)maxRecords) as List<Tuple<double, double>>;
|
||||
|
||||
var dsGen0 = MinuteMetrics.Select(z => new Tuple<double, double>(z.t.ToOADate(), z.Gen0)).ToList();
|
||||
dsGen0 = Util.DataUtil.LargestTriangleThreeBuckets(dsGen0, (int)maxRecords) as List<Tuple<double, double>>;
|
||||
|
||||
var dsGen1 = MinuteMetrics.Select(z => new Tuple<double, double>(z.t.ToOADate(), z.Gen1)).ToList();
|
||||
dsGen1 = Util.DataUtil.LargestTriangleThreeBuckets(dsGen1, (int)maxRecords) as List<Tuple<double, double>>;
|
||||
|
||||
var dsGen2 = MinuteMetrics.Select(z => new Tuple<double, double>(z.t.ToOADate(), z.Gen2)).ToList();
|
||||
dsGen2 = Util.DataUtil.LargestTriangleThreeBuckets(dsGen2, (int)maxRecords) as List<Tuple<double, double>>;
|
||||
|
||||
|
||||
var ret = new
|
||||
{
|
||||
cpu = dsCPU.Select(z => new MetricDouble(DateTime.FromOADate(z.Item1), z.Item2)).ToArray(),
|
||||
gen0 = dsGen0.Select(z => new MetricInt(DateTime.FromOADate(z.Item1), z.Item2)).ToArray(),
|
||||
gen1 = dsGen1.Select(z => new MetricInt(DateTime.FromOADate(z.Item1), z.Item2)).ToArray(),
|
||||
gen2 = dsGen2.Select(z => new MetricInt(DateTime.FromOADate(z.Item1), z.Item2)).ToArray(),
|
||||
cpu = dsCPU.Select(z => new MetricDouble(DateTime.FromOADate(z.Item1), z.Item2)).ToArray(),
|
||||
allocated = dsAllocated.Select(z => new MetricLong(DateTime.FromOADate(z.Item1), z.Item2 / MB)).ToArray(),
|
||||
workingSet = dsWorkingSet.Select(z => new MetricLong(DateTime.FromOADate(z.Item1), z.Item2 / MB)).ToArray(),
|
||||
privateBytes = dsPrivateBytes.Select(z => new MetricLong(DateTime.FromOADate(z.Item1), z.Item2 / MB)).ToArray()
|
||||
|
||||
Reference in New Issue
Block a user