pub struct RunReceipt {
pub schema: String,
pub tool: ToolInfo,
pub run: RunMeta,
pub bench: BenchMeta,
pub samples: Vec<Sample>,
pub stats: Stats,
}Expand description
A versioned receipt from a single benchmark run (perfgate.run.v1).
§Examples
use perfgate_types::*;
let receipt = RunReceipt {
schema: RUN_SCHEMA_V1.to_string(),
tool: ToolInfo { name: "perfgate".into(), version: "0.1.0".into() },
run: RunMeta {
id: "run-1".into(),
started_at: "2024-01-01T00:00:00Z".into(),
ended_at: "2024-01-01T00:00:01Z".into(),
host: HostInfo {
os: "linux".into(), arch: "x86_64".into(),
cpu_count: None, memory_bytes: None, hostname_hash: None,
},
},
bench: BenchMeta {
name: "my-bench".into(), cwd: None,
command: vec!["echo".into(), "hello".into()],
repeat: 3, warmup: 0, work_units: None, timeout_ms: None,
},
samples: vec![],
stats: Stats {
wall_ms: U64Summary::new(100, 90, 120 ),
cpu_ms: None, page_faults: None, ctx_switches: None,
max_rss_kb: None, io_read_bytes: None, io_write_bytes: None,
network_packets: None, energy_uj: None, binary_bytes: None, throughput_per_s: None,
},
};
// Serialize to JSON
let json = serde_json::to_string(&receipt).unwrap();
assert!(json.contains("perfgate.run.v1"));Fields§
§schema: String§tool: ToolInfo§run: RunMeta§bench: BenchMeta§samples: Vec<Sample>§stats: StatsTrait Implementations§
Source§impl Clone for RunReceipt
impl Clone for RunReceipt
Source§fn clone(&self) -> RunReceipt
fn clone(&self) -> RunReceipt
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RunReceipt
impl Debug for RunReceipt
Source§impl<'de> Deserialize<'de> for RunReceipt
impl<'de> Deserialize<'de> for RunReceipt
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 JsonSchema for RunReceipt
impl JsonSchema for RunReceipt
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for RunReceipt
impl PartialEq for RunReceipt
Source§impl Serialize for RunReceipt
impl Serialize for RunReceipt
impl StructuralPartialEq for RunReceipt
Auto Trait Implementations§
impl Freeze for RunReceipt
impl RefUnwindSafe for RunReceipt
impl Send for RunReceipt
impl Sync for RunReceipt
impl Unpin for RunReceipt
impl UnsafeUnpin for RunReceipt
impl UnwindSafe for RunReceipt
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