using MarketData;
using MarketData.Utils;
using Microsoft.AspNetCore.Mvc;
using LogLevel = MarketData.LogLevel;


namespace MarketDataServer.Controllers
{
  [ApiController]
  [Route("api/[controller]/[action]")]
  public class PingController : ControllerBase
  {
    [HttpGet(Name = "GetPing")]
    public bool GetPing()
    {
      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()
    {
      Profiler profiler = new Profiler();
      MDTrace.WriteLine(LogLevel.DEBUG,$"Start");
      MDTrace.WriteLine(LogLevel.DEBUG,$"Done, total took {profiler.End()} (ms)");
      return Environment.OSVersion.VersionString;
    }    
  }
}
