public async Task <BenchMarkResponse> RunBenchMark(BenchMarkType benchMarkType) { var client = _httpClientFactory.CreateBenchMarkClient(benchMarkType); long result = 0; try { var stopWatch = Stopwatch.StartNew(); var response = await client.GetAsync($"api/Trigger?name=BenchMark"); result = stopWatch.ElapsedMilliseconds; return(response.IsSuccessStatusCode ? new BenchMarkResponse(true, result) : new BenchMarkResponse(false, result)); } catch (Exception e) { return(new BenchMarkResponse(false, result)); } }