public void ProcessRequest(HttpContext context) { try { var requestParams = RequestParams.FromHttpRequest(context.Request); var graphiteParams = requestParams.ToGraphiteParams(); var rawData = GraphiteDataRetriever.GetRawData(graphiteParams); var data = Data.FromRawData(rawData); context.Response.WriteOkResponse(data); } catch (Exception exception) { context.Response.WriteErrorResponse(exception); } }
static void Main(string[] args) { Console.SetWindowSize(100, 30); var consoleParams = ConsoleParams.From(args); var graphiteParams = consoleParams.ToGraphiteParams(); var rawData = GraphiteDataRetriever.GetRawData(graphiteParams); var data = Data.FromRawData(rawData); foreach (var metric in data.Metrics) { Console.Clear(); Console.Write(metric); Thread.Sleep(2000); } }