public async Task <(int, string)> Handle(HttpRequest request) { #region Function Setup // Start timer elaps.StartTimer(); await elaps.LogStartAsync(); //Read input string var reader = new StreamReader(request.Body); var input = await reader.ReadToEndAsync(); await elaps.ReadFunctionCallDoc(input); #endregion await Execute(); await elaps.CallChildren(); #region Function Teardown //Stop timer var duration = elaps.StopTimer(); await elaps.LogStopAsync(); #endregion return(200, $"Hello! Your input was {input}"); }
public async Task <(int, string)> Handle(HttpRequest request) { #region Function Setup var elaps = new ELAPSFunctionHandler(Environment.GetEnvironmentVariable("mongoEndpoint")); //Read input string var reader = new StreamReader(request.Body); var input = await reader.ReadToEndAsync(); elaps.Function.Key = input; // Start timer elaps.StartTimer(); _ = elaps.LogStartAsync(); elaps.ReadFunctionCallDoc(input); #endregion var callChildren = Execute(elaps); if (callChildren) { _ = elaps.CallChildren(); } #region Function Teardown //Stop timer var duration = elaps.StopTimer(); await elaps.LogStopAsync(duration); #endregion return(200, $"Function execution {input}"); }