Add profiling to MarketDataServer controllers

This commit is contained in:
2025-04-27 10:55:25 -04:00
parent cebf9f63e6
commit 1c1c0c35f4
9 changed files with 161 additions and 32 deletions

View File

@@ -1,4 +1,5 @@
using MarketData;
using MarketData.Utils;
using Microsoft.AspNetCore.Mvc;
using LogLevel = MarketData.LogLevel;
@@ -12,14 +13,18 @@ namespace MarketDataServer.Controllers
[HttpGet(Name = "GetPing")]
public bool GetPing()
{
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("[{0:G}][PingController::GetPing]", DateTime.Now));
Profiler profiler = new Profiler();
MDTrace.WriteLine(LogLevel.DEBUG,$"Start");
MDTrace.WriteLine(LogLevel.DEBUG,$"Done, total took {profiler.End()} (ms)");
return true;
}
[HttpGet(Name = "GetSystemInfo")]
public String GetSystemInfo()
{
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("[{0:G}][PingController::GetSystemInfo]", DateTime.Now));
Profiler profiler = new Profiler();
MDTrace.WriteLine(LogLevel.DEBUG,$"Start");
MDTrace.WriteLine(LogLevel.DEBUG,$"Done, total took {profiler.End()} (ms)");
return Environment.OSVersion.VersionString;
}
}