This commit is contained in:
2020-05-30 20:10:41 +00:00
parent 217488872f
commit 7f7b5c3ac2
7 changed files with 44 additions and 76 deletions

View File

@@ -14,7 +14,7 @@ using Newtonsoft.Json.Linq;
using AyaNova.Models;
using AyaNova.Api.ControllerHelpers;
using AyaNova.Biz;
using StackExchange.Profiling;
namespace AyaNova.Api.Controllers
{
@@ -33,6 +33,7 @@ namespace AyaNova.Api.Controllers
private readonly ApiServerState serverState;
private const int DEFAULT_MAX_RECORDS = 400;
private const long MB = (1024 * 1024);
/// <summary>
/// ctor
@@ -40,15 +41,37 @@ namespace AyaNova.Api.Controllers
/// <param name="dbcontext"></param>
/// <param name="logger"></param>
/// <param name="apiServerState"></param>
/// <param name="prof"></param>
public ServerMetricsController(AyContext dbcontext, ILogger<LogFilesController> logger, ApiServerState apiServerState)
{
ct = dbcontext;
log = logger;
serverState = apiServerState;
serverState = apiServerState;
}
/// <summary>
///
/// </summary>
/// <returns></returns>
[HttpGet("prof")]
public async Task<IActionResult> GetProfileMetrics()
{
using (MiniProfiler.Current.Step("Get Metrics test"))
{
await Task.Delay(1500);
//await Task.CompletedTask;
}
//MiniProfiler.Current.RenderPlainText()
return Content(MiniProfiler.Current.RenderPlainText());
}
/// <summary>
/// Get Memory and CPU server metrics for time period specified
/// </summary>