pub struct BenchmarkReceipt {
pub timestamp: DateTime<Utc>,
pub commit_hash: String,
pub machine_fingerprint: String,
pub results: Vec<BenchmarkResult>,
pub note: Option<String>,
}Expand description
A benchmark receipt captures the results and context of a single benchmark run.
Receipts are keyed to:
- A commit hash (git SHA)
- A machine fingerprint
- A timestamp (UTC)
This enables reproducible diffs between runs across different machines.
Fields§
§timestamp: DateTime<Utc>Timestamp of the benchmark run (UTC)
commit_hash: StringGit commit SHA of the code being benchmarked
machine_fingerprint: StringMachine fingerprint (hostname + username + arch + OS + cpu count + machine-id)
results: Vec<BenchmarkResult>Benchmark results indexed by name
note: Option<String>Optional note about the run environment
Implementations§
Source§impl BenchmarkReceipt
impl BenchmarkReceipt
Sourcepub fn new(commit_hash: String, machine_fingerprint: String) -> Self
pub fn new(commit_hash: String, machine_fingerprint: String) -> Self
Create a new receipt with the current timestamp.
Sourcepub fn with_fingerprint(
commit_hash: String,
fingerprint: &MachineFingerprint,
) -> Self
pub fn with_fingerprint( commit_hash: String, fingerprint: &MachineFingerprint, ) -> Self
Create a new receipt from a fingerprint struct.
Sourcepub fn add_result(&mut self, result: BenchmarkResult)
pub fn add_result(&mut self, result: BenchmarkResult)
Add a benchmark result to this receipt.
Sourcepub fn receipt_hash(&self) -> String
pub fn receipt_hash(&self) -> String
Compute a short hash of this receipt for quick comparison.
Uses only the commit hash, machine fingerprint, and result names/values. Timestamp is excluded to allow comparing logically equivalent runs.
Sourcepub fn from_json(bytes: &[u8]) -> Result<Self, QuantEvalError>
pub fn from_json(bytes: &[u8]) -> Result<Self, QuantEvalError>
Deserialize a receipt from JSON bytes.
Trait Implementations§
Source§impl Clone for BenchmarkReceipt
impl Clone for BenchmarkReceipt
Source§fn clone(&self) -> BenchmarkReceipt
fn clone(&self) -> BenchmarkReceipt
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more