Exemplo n.º 1
0
 public void ProcessRequest(HttpContext context)
 {
     try
     {
         MetricsInfo info = new MetricsInfo {
             CommandInfoList    = HystrixStreamHandler.GetHystrixCommandInfoList(),
             ThreadPoolInfoList = HystrixStreamHandler.GetHystrixThreadPoolList()
         };
         info.CommandCount            = info.CommandInfoList.Count;
         info.ThreadPoolCount         = info.ThreadPoolInfoList.Count;
         context.Response.ContentType = "application/json";
         context.Response.Write(info.ToJson());
     }
     catch (Exception exception)
     {
         context.Response.ContentType = "text/plain";
         context.Response.Write(exception.Message);
     }
 }
Exemplo n.º 2
0
 public void ProcessRequest(HttpContext context)
 {
     try
     {
         MetricsInfo metrics = new MetricsInfo()
         {
             CommandInfoList    = HystrixStreamHandler.GetHystrixCommandInfoList(),
             ThreadPoolInfoList = HystrixStreamHandler.GetHystrixThreadPoolList()
         };
         metrics.CommandCount         = metrics.CommandInfoList.Count;
         metrics.ThreadPoolCount      = metrics.ThreadPoolInfoList.Count;
         context.Response.ContentType = HttpContentTypes.Json;
         context.Response.Write(metrics.ToJson());
     }
     catch (Exception ex)
     {
         context.Response.ContentType = HttpContentTypes.PlainText;
         context.Response.Write(ex.Message);
     }
 }