private void UpdateAggregationEntries() { if (!_fileRecordInfoList.Any()) { return; } AggregationEntries.Clear(); _supressCollectionChanged = true; foreach (var recordInfo in _fileRecordInfoList) { var localSession = _recordManager.LoadData(recordInfo.FullPath); var frametimes = localSession.Runs.SelectMany(r => r.CaptureData.MsBetweenPresents).ToList(); var metricAnalysis = _statisticProvider .GetMetricAnalysis(frametimes, SelectedSecondMetric.ConvertToString(), SelectedThirdMetric.ConvertToString()); AggregationEntries.Add(new AggregationEntry() { GameName = recordInfo.GameName, CreationDate = recordInfo.CreationDate, CreationTime = recordInfo.CreationTime, AverageValue = metricAnalysis.Average, SecondMetricValue = metricAnalysis.Second, ThirdMetricValue = metricAnalysis.Third, MetricAnalysis = metricAnalysis }); } _supressCollectionChanged = false; OnAggregationEntriesChanged(); }
private void SetRowSeries() { ComparisonRowChartSeriesCollection = new SeriesCollection() { new RowSeries { Title = $"{EMetric.Average.GetDescription()} FPS", Values = new ChartValues <double>(), Fill = new SolidColorBrush(Color.FromRgb(34, 151, 243)), HighlightFill = new SolidColorBrush(Color.FromRgb(122, 192, 247)), Stroke = Brushes.Transparent, StrokeThickness = 2, DataLabels = true, MaxRowHeigth = BarChartMaxRowHeight, RowPadding = 0, UseRelativeMode = true } }; if (SelectedSecondMetric != EMetric.None) { // second metric ComparisonRowChartSeriesCollection.Add( new RowSeries { Title = $"{SelectedSecondMetric.GetDescription()} FPS", Values = new ChartValues <double>(), Fill = new SolidColorBrush(Color.FromRgb(241, 125, 32)), HighlightFill = new SolidColorBrush(Color.FromRgb(245, 164, 98)), Stroke = Brushes.Transparent, StrokeThickness = 2, DataLabels = true, MaxRowHeigth = BarChartMaxRowHeight, RowPadding = 0, UseRelativeMode = true }); } if (SelectedThirdMetric != EMetric.None) { // third metric ComparisonRowChartSeriesCollection.Add( new RowSeries { Title = $"{SelectedThirdMetric.GetDescription()} FPS", Values = new ChartValues <double>(), Fill = new SolidColorBrush(Color.FromRgb(255, 180, 0)), HighlightFill = new SolidColorBrush(Color.FromRgb(245, 217, 128)), Stroke = Brushes.Transparent, StrokeThickness = 2, DataLabels = true, MaxRowHeigth = BarChartMaxRowHeight, RowPadding = 0, UseRelativeMode = true }); } }
private void AddAggregationEntry(IFileRecordInfo recordInfo, Session session) { if (recordInfo != null) { if (_fileRecordInfoList.Any()) { if (!_fileRecordInfoList.All(info => info.ProcessName == recordInfo.ProcessName)) { return; } } _fileRecordInfoList.Add(recordInfo); } else { return; } List <double> frametimes = session?.FrameTimes; if (session == null) { var localSession = RecordManager.LoadData(recordInfo.FullPath); frametimes = localSession?.FrameTimes; } var metricAnalysis = _statisticProvider .GetMetricAnalysis(frametimes, SelectedSecondMetric.ConvertToString(), SelectedThirdMetric.ConvertToString()); AggregationEntries.Add(new AggregationEntry() { GameName = recordInfo.GameName, CreationDate = recordInfo.CreationDate, CreationTime = recordInfo.CreationTime, AverageValue = metricAnalysis.Average, SecondMetricValue = metricAnalysis.Second, ThirdMetricValue = metricAnalysis.Third, MetricAnalysis = metricAnalysis, FileRecordInfo = recordInfo }); }
private void AddAggregationEntry(IFileRecordInfo recordInfo, ISession session) { if (recordInfo == null) { return; } if (_fileRecordInfoList.Any()) { if (!_fileRecordInfoList.All(info => info.ProcessName == recordInfo.ProcessName)) { return; } } _fileRecordInfoList.Add(recordInfo); session = session ?? _recordManager.LoadData(recordInfo.FullPath); var frametimes = session.Runs.SelectMany(r => r.CaptureData.MsBetweenPresents).ToList(); var metricAnalysis = _statisticProvider .GetMetricAnalysis(frametimes, SelectedSecondMetric.ConvertToString(), SelectedThirdMetric.ConvertToString()); AggregationEntries.Add(new AggregationEntry() { GameName = recordInfo.GameName, CreationDate = recordInfo.CreationDate, CreationTime = recordInfo.CreationTime, AverageValue = metricAnalysis.Average, SecondMetricValue = metricAnalysis.Second, ThirdMetricValue = metricAnalysis.Third, MetricAnalysis = metricAnalysis, FileRecordInfo = recordInfo }); }