Add profiling to MarketDataServer controllers
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using MarketData;
|
||||
using MarketData.DataAccess;
|
||||
using MarketData.Utils;
|
||||
using MarketDataServer.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using LogLevel = MarketData.LogLevel;
|
||||
@@ -13,9 +14,10 @@ namespace MarketDataServer.Controllers
|
||||
[HttpGet(Name = "GetWatchList")]
|
||||
public IEnumerable<String> GetWatchList(String token,String watchList)
|
||||
{
|
||||
Profiler profiler = new Profiler();
|
||||
try
|
||||
{
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("[{0:G}][WatchListController::GetWatchList]", DateTime.Now));
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,$"Start");
|
||||
if (!Authorizations.GetInstance().IsAuthorized(token)) return null;
|
||||
return WatchListDA.GetWatchList(watchList);
|
||||
}
|
||||
@@ -24,6 +26,10 @@ namespace MarketDataServer.Controllers
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,$"Exception:{exception.ToString()}");
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,$"Done, total took {profiler.End()} (ms)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user