public async Task <LoadTestData> GetHealth(int itetration) { Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); var msg = new HttpRequestMessage(HttpMethod.Get, healthProdUrl); var response = await client.SendAsync(msg) .ConfigureAwait(false); //var rTime = response.Headers.GetValues("DS-ResponseTime").FirstOrDefault(); stopWatch.Stop(); var result = new LoadTestData() { ServerProcessingTime = 6, TotalTime = stopWatch.ElapsedMilliseconds }; Console.WriteLine($"Result#{itetration}: {result.ServerProcessingTime} - {result.TotalTime}"); return(result); }
public async Task <LoadTestData> GetGroupInfo(int itetration) { Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); var msg = new HttpRequestMessage(HttpMethod.Get, groupInfoUrl); msg.Headers.Add("Authorization", token); var response = await client.SendAsync(msg) .ConfigureAwait(false); var rTime = response.Headers.GetValues("DS-ResponseTime").FirstOrDefault(); stopWatch.Stop(); var result = new LoadTestData() { ServerProcessingTime = int.Parse(rTime), TotalTime = stopWatch.ElapsedMilliseconds, StatusCode = response.StatusCode }; Console.WriteLine($"Result#{itetration}: {result.ServerProcessingTime} - {result.TotalTime}"); return(result); }