Пример #1
0
        private async Task GenerateGlobalRerunLatencyChart()
        {
            // Breaks the method into an async method so it can work in peace and be awaited.
            await Task.Delay(1).ConfigureAwait(false);

            var data =
                Data.ReaderStatsBySecond.
                ToList().
                OrderBy(x => x.Key).
                Select(x => new
            {
                AvgPoint = new DataPoint(x.Key, x.Average(z => z.RerunLatency)),
                MaxPoint = new DataPoint(x.Key, x.Max(z => z.RerunLatency)),
            }).
                ToList();

            LineSeries maxSeries = new LineSeries {
                Title = "Maximum", Color = OxyColors.Firebrick,
            };
            LineSeries avgSeries = new LineSeries {
                Title = "Average",
            };

            maxSeries.Points.AddRange(data.Select(x => x.MaxPoint));
            avgSeries.Points.AddRange(data.Select(x => x.AvgPoint));

            lock (GlobalRerunLatencyPlot.SyncRoot)
            {
                GlobalRerunLatencyPlot.Series.Clear();
                GlobalRerunLatencyPlot.Series.Add(maxSeries);
                GlobalRerunLatencyPlot.Series.Add(avgSeries);
            }

            GlobalRerunLatencyPlot.InvalidatePlot(true);
        }
Пример #2
0
 private void ResetGlobalRerunLatencyPlotButton_ClickHandler(object sender, RoutedEventArgs e)
 {
     GlobalRerunLatencyPlot.ResetAllAxes();
 }