Class TrendDataProcessor
java.lang.Object
de.cuioss.benchmarking.common.report.TrendDataProcessor
Processes historical benchmark data for time-series analysis and trend visualization.
This processor specializes in time-series analysis of benchmark results:
- Loading and managing historical benchmark data
- Detecting performance trends over time
- Preparing data for trend visualization charts
- Tracking changes between benchmark runs
Use this class when you need to analyze benchmark performance over time.
For pure statistical computations, use StatisticsCalculator.
For processing individual benchmark results, use MetricsComputer.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a single historical data point.static final recordRepresents calculated trend metrics. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateTrends(BenchmarkMetrics currentMetrics, List<TrendDataProcessor.HistoricalDataPoint> historicalData) Calculates trend metrics from historical data using EWMA (Exponentially Weighted Moving Average).generateTrendChartData(List<TrendDataProcessor.HistoricalDataPoint> historicalData, BenchmarkMetrics currentMetrics) Generates chart-ready trend data for visualization.loadHistoricalData(Path historyDir) Loads historical data files from the history directory.
-
Constructor Details
-
TrendDataProcessor
public TrendDataProcessor()
-
-
Method Details
-
loadHistoricalData
Loads historical data files from the history directory.- Parameters:
historyDir- path to the history directory- Returns:
- list of historical benchmark data points, sorted by timestamp (newest first)
-
calculateTrends
public TrendDataProcessor.TrendMetrics calculateTrends(BenchmarkMetrics currentMetrics, List<TrendDataProcessor.HistoricalDataPoint> historicalData) Calculates trend metrics from historical data using EWMA (Exponentially Weighted Moving Average).EWMA provides a weighted baseline that emphasizes recent performance while still considering historical context. This prevents false negatives when comparing identical consecutive runs after a major performance shift.
- Parameters:
currentMetrics- current benchmark metricshistoricalData- previous benchmark results (ordered newest first)- Returns:
- trend metrics with analysis
-
generateTrendChartData
public Map<String,Object> generateTrendChartData(List<TrendDataProcessor.HistoricalDataPoint> historicalData, BenchmarkMetrics currentMetrics) Generates chart-ready trend data for visualization.- Parameters:
historicalData- historical benchmark resultscurrentMetrics- current benchmark metrics (optional)- Returns:
- map containing chart labels and datasets
-