private void LoadGraphs() { long startTime = 0; if (Result.Results.Any()) { startTime = Result.Results.First().StartTime.Ticks; } var result = Result.Results .Where(r => !r.IsError) .GroupBy(r => ((r.StartTime.Ticks - startTime) / 10000 + r.ResponseTime) / 1000) .OrderBy(r => r.Key) .Select(r => new DataPoint(r.Key, r.Count())); RequestsPerSecondGraph.Draw(result); var i = 1; var ms = Result.Results .Where(r => !r.IsError) .OrderByDescending(r => r.ResponseTime) .Select(r => new DataPoint(i++, r.ResponseTime)); ResponseTimeGraph.Draw(ms); }
public async Task Load(WorkerResult workerResult, ResultWindowItem baselineResult) { var taskResult = await GenerateAsync(workerResult); _resultWindowItem = taskResult.ResultWindowItem; RequestsPerSecondGraph.Draw(taskResult.Throughput, "{Y:#,0} rps"); var dataPoints = workerResult.Histogram.Select((count, i) => new DataPoint(i / 80.0 * (_resultWindowItem.Max - _resultWindowItem.Min) + _resultWindowItem.Min, count)).ToList(); HistogramGraph.Draw(dataPoints, "{X:0.000} ms"); Title = "Netling - " + _resultWindowItem.Name; ThreadsValueUserControl.Value = _resultWindowItem.Threads.ToString(); RequestsValueUserControl.Value = _resultWindowItem.JobsPerSecond.ToString("#,0"); ElapsedValueUserControl.Value = $"{_resultWindowItem.ElapsedSeconds:0}"; BandwidthValueUserControl.Value = _resultWindowItem.Bandwidth.ToString("#,0"); ErrorsValueUserControl.Value = _resultWindowItem.Errors.ToString("#,0"); MedianValueUserControl.Value = string.Format(_resultWindowItem.Median > 5 ? "{0:#,0}" : "{0:0.000}", _resultWindowItem.Median); StdDevValueUserControl.Value = string.Format(_resultWindowItem.StdDev > 5 ? "{0:#,0}" : "{0:0.000}", _resultWindowItem.StdDev); MinValueUserControl.Value = string.Format(_resultWindowItem.Min > 5 ? "{0:#,0}" : "{0:0.000}", _resultWindowItem.Min); MaxValueUserControl.Value = string.Format(_resultWindowItem.Max > 5 ? "{0:#,0}" : "{0:0.000}", _resultWindowItem.Max); MinTextBlock.Text = MinValueUserControl.Value + " ms"; MaxTextBlock.Text = MaxValueUserControl.Value + " ms"; if (workerResult.StatusCodes.Any(s => s.Key != 200)) { StatusCodesTab.Visibility = Visibility.Visible; StatusCodesListBox.ItemsSource = workerResult.StatusCodes .Select(s => new { Name = $"{s.Key} - {(s.Key > 0 ? ((System.Net.HttpStatusCode)s.Key).ToString() : "")}", Count = s.Value }) .ToList(); if (!workerResult.Exceptions.Any()) { StatusCodesTab.Focus(); } } if (workerResult.Exceptions.Any()) { ExceptionsTab.Visibility = Visibility.Visible; ExceptionsTextBox.Text = string.Join("\r\n\r\n----\r\n\r\n", workerResult.Exceptions.Select(e => e.ToString())); ExceptionsTab.Focus(); } if (baselineResult != null) { LoadBaseline(baselineResult); } }
private void LoadGraphs(JobResult result) { var max = (int)Math.Floor(result.ElapsedMilliseconds / 1000); var dataPoints = result.Results .Where(r => !r.IsError) .GroupBy(r => (int)((r.Elapsed + r.ResponseTime) / 1000)) .Where(r => r.Key < max) .OrderBy(r => r.Key) .Select(r => new DataPoint(r.Key, r.Count())); RequestsPerSecondGraph.Draw(dataPoints); }
public async Task Load(WorkerResult workerResult) { var taskResult = await GenerateAsync(workerResult); _resultWindowItem = taskResult.ResultWindowItem; RequestsPerSecondGraph.Draw(taskResult.Throughput, "{Y:#,0} rps"); var dataPoints = workerResult.Histogram.Select((count, i) => new DataPoint(i / 80.0 * (_resultWindowItem.Max - _resultWindowItem.Min) + _resultWindowItem.Min, count)).ToList(); HistogramGraph.Draw(dataPoints, "{X:0.000} ms"); Title = "Netling - " + _resultWindowItem.Url; ThreadsValueUserControl.Value = _resultWindowItem.Threads.ToString(); PipeliningValueUserControl.Value = _resultWindowItem.Pipelining.ToString(); ThreadAffinityValueUserControl.Value = _resultWindowItem.ThreadAffinity ? "ON" : "OFF"; RequestsValueUserControl.Value = _resultWindowItem.JobsPerSecond.ToString("#,0"); ElapsedValueUserControl.Value = $"{_resultWindowItem.ElapsedSeconds:0}"; BandwidthValueUserControl.Value = _resultWindowItem.Bandwidth.ToString("#,0"); ErrorsValueUserControl.Value = _resultWindowItem.Errors.ToString("#,0"); MedianValueUserControl.Value = string.Format(_resultWindowItem.Median > 5 ? "{0:#,0}" : "{0:0.000}", _resultWindowItem.Median); StdDevValueUserControl.Value = string.Format(_resultWindowItem.StdDev > 5 ? "{0:#,0}" : "{0:0.000}", _resultWindowItem.StdDev); MinValueUserControl.Value = string.Format(_resultWindowItem.Min > 5 ? "{0:#,0}" : "{0:0.000}", _resultWindowItem.Min); MaxValueUserControl.Value = string.Format(_resultWindowItem.Max > 5 ? "{0:#,0}" : "{0:0.000}", _resultWindowItem.Max); MinTextBlock.Text = MinValueUserControl.Value + " ms"; MaxTextBlock.Text = MaxValueUserControl.Value + " ms"; var errors = new Dictionary <string, string>(); foreach (var statusCode in workerResult.StatusCodes) { errors.Add(statusCode.Key.ToString(), statusCode.Value.ToString("#,0")); } foreach (var exception in workerResult.Exceptions) { errors.Add(exception.Key.ToString(), exception.Value.ToString("#,0")); } ErrorsListView.ItemsSource = errors; if (_sender.ResultWindowItem != null) { LoadBaseline(_sender.ResultWindowItem); } }