pub struct BenchmarkResult {
pub name: String,
pub value: f64,
pub unit: String,
pub timestamp: String,
pub gpu_id: String,
pub success: bool,
pub error: Option<String>,
}Expand description
A single benchmark measurement result.
Contains the benchmark name, numeric value, unit, timestamp, and optional
GPU identifier. Serializes to/from JSON compatible with benchmark_logs.rs
parsing logic.
§Validation
- VAL-INFRA-013: BenchmarkResult struct with name, value, unit, timestamp, gpu_id; JSON serialization round-trip with benchmark_logs.rs
Fields§
§name: StringHuman-readable benchmark name (e.g., “memory_bandwidth”).
value: f64Numeric benchmark value.
unit: StringUnit of measurement (e.g., “GB/s”, “ms”, “TFLOPS”).
timestamp: StringISO 8601 timestamp when the benchmark was recorded.
gpu_id: StringPCI bus ID of the GPU used (e.g., “01:00.0”), or empty if CPU-only.
success: boolWhether the benchmark succeeded.
error: Option<String>Optional error message (set when success is false).
Implementations§
Source§impl BenchmarkResult
impl BenchmarkResult
Sourcepub fn new(name: &str, value: f64, unit: &str) -> Self
pub fn new(name: &str, value: f64, unit: &str) -> Self
Create a new successful benchmark result with the current timestamp.
Sourcepub fn with_gpu(name: &str, value: f64, unit: &str, gpu_id: &str) -> Self
pub fn with_gpu(name: &str, value: f64, unit: &str, gpu_id: &str) -> Self
Create a new benchmark result with a specific GPU ID.
Sourcepub fn to_json_pretty(&self) -> Result<String, Error>
pub fn to_json_pretty(&self) -> Result<String, Error>
Serialize to a pretty-printed JSON string.
Trait Implementations§
Source§impl Clone for BenchmarkResult
impl Clone for BenchmarkResult
Source§impl Debug for BenchmarkResult
impl Debug for BenchmarkResult
Source§impl<'de> Deserialize<'de> for BenchmarkResult
impl<'de> Deserialize<'de> for BenchmarkResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for BenchmarkResult
impl Display for BenchmarkResult
Source§impl PartialEq for BenchmarkResult
impl PartialEq for BenchmarkResult
Source§impl Serialize for BenchmarkResult
impl Serialize for BenchmarkResult
impl StructuralPartialEq for BenchmarkResult
Auto Trait Implementations§
impl Freeze for BenchmarkResult
impl RefUnwindSafe for BenchmarkResult
impl Send for BenchmarkResult
impl Sync for BenchmarkResult
impl Unpin for BenchmarkResult
impl UnsafeUnpin for BenchmarkResult
impl UnwindSafe for BenchmarkResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.