private void AddMetricSeries(PlotModel model, string title, IBenchmarkCounter icounter) { BenchmarkCounterIntervals counter = icounter as BenchmarkCounterIntervals; if (counter == null) { return; } IEnumerable <float> data = counter.GetData(); if (data == null) { return; } LineSeries series = new LineSeries(); series.Title = title; series.MarkerType = MarkerType.None; series.Smooth = false; series.StrokeThickness = 1; IEnumerable <float> fps = data.Select(t => 1000.0f / t); int index = 0; foreach (float value in fps) { series.Points.Add(new DataPoint(++index, value)); } model.Series.Add(series); }
private void AddMetricSummary(RichTextBox rtbReport, string title, IBenchmarkCounter counter) { if (counter is BenchmarkCounterIntervals) { AddMetricSummary(rtbReport, title, counter as BenchmarkCounterIntervals); } else if (counter is BenchmarkCounterBandwidth) { AddMetricSummary(rtbReport, title, counter as BenchmarkCounterBandwidth); } }