1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Performance measurement data models.
//!
//! This module defines the core data structures for capturing
//! performance measurements with system context and metadata.
use std::collections::HashMap;
use std::time::SystemTime;
use serde::{Deserialize, Serialize};
/// Single performance measurement with context and parameters.
///
/// Captures a point-in-time performance measurement with
/// associated system context and test configuration.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PerformanceMeasurement {
/// Timestamp of measurement
pub timestamp: SystemTime,
/// Performance value (e.g., operations per second)
pub value: f64,
/// Test parameters (if any)
pub parameters: HashMap<String, String>,
/// System context
pub context: SystemContext,
/// Confidence in this measurement
pub confidence: f64,
}
/// System environment context during performance measurement.
///
/// Captures relevant system state that may influence performance
/// to provide context for measurement interpretation.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SystemContext {
/// Git commit hash
pub commit_hash: Option<String>,
/// Compiler version
pub compiler_version: String,
/// System load during measurement
pub system_load: f64,
/// Available memory during measurement
pub available_memory_mb: u64,
/// Temperature (if available)
pub temperature: Option<f64>,
}