pub struct BenchmarkDefinition {
pub name: String,
pub description: String,
pub relations: Vec<RelationSource>,
pub queries: Vec<QueryDefinition>,
pub generator: Option<GeneratorSpec>,
}Expand description
A benchmark definition loaded from a YAML file.
A benchmark is either static — relations and queries are populated
directly from the YAML — or generated — generator describes how to
materialise the data on demand via a kermit-rdf pipeline. The two are
mutually exclusive; BenchmarkDefinition::validate enforces the XOR.
Fields§
§name: StringUnique benchmark name. Must match the filename stem.
description: StringHuman-readable description, shown in bench list output.
relations: Vec<RelationSource>The relations referenced by this benchmark’s queries. Empty for a
generator-driven YAML; the relations are produced by the generator
pipeline and recorded in the cache-side benchmark.yml.
queries: Vec<QueryDefinition>One or more named queries to run against the relations. Empty for a generator-driven YAML; the queries are produced by the generator pipeline.
generator: Option<GeneratorSpec>Optional declarative generator spec. When present, bench run runs
the corresponding kermit-rdf pipeline on first invocation and
caches the artefacts; subsequent runs short-circuit on the cached
meta.json if the spec hash matches.
Implementations§
Source§impl BenchmarkDefinition
impl BenchmarkDefinition
Sourcepub fn validate(&self) -> Result<(), BenchError>
pub fn validate(&self) -> Result<(), BenchError>
Validates structural invariants of the benchmark definition.
Checks that name, relations, and queries are non-empty, that
every query has a non-empty name and query, and that relation
names and query names are unique within the benchmark.
§Errors
Returns BenchError::Invalid describing the first failing
constraint.
§Example
use kermit_bench::{BenchmarkDefinition, QueryDefinition, RelationSource};
let def = BenchmarkDefinition {
name: "triangle".into(),
description: "Triangle query".into(),
relations: vec![RelationSource {
name: "edge".into(),
url: "https://example.com/edge.parquet".into(),
}],
queries: vec![QueryDefinition {
name: "triangle".into(),
description: "triangle".into(),
query: "T(X, Y, Z) :- edge(X, Y), edge(Y, Z), edge(X, Z).".into(),
}],
generator: None,
};
assert!(def.validate().is_ok());Trait Implementations§
Source§impl Clone for BenchmarkDefinition
impl Clone for BenchmarkDefinition
Source§fn clone(&self) -> BenchmarkDefinition
fn clone(&self) -> BenchmarkDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more