Skip to main content

Crate perfgate_types

Crate perfgate_types 

Source
Expand description

Shared types for perfgate.

Design goal: versioned, explicit, boring. These structs are used for receipts, PR comments, and (eventually) long-term baselines.

Part of the perfgate workspace.

§Examples

Round-trip a ToolInfo through JSON:

use perfgate_types::ToolInfo;

let tool = ToolInfo { name: "perfgate".into(), version: "1.0.0".into() };
let json = serde_json::to_string(&tool).unwrap();
let back: ToolInfo = serde_json::from_str(&json).unwrap();
assert_eq!(tool, back);

§Feature Flags

  • arbitrary: Enables Arbitrary derive for structure-aware fuzzing with cargo-fuzz.

Re-exports§

pub use validation::BENCH_NAME_MAX_LEN;
pub use validation::BENCH_NAME_PATTERN;
pub use validation::ValidationError as BenchNameValidationError;
pub use validation::validate_bench_name;
pub use error::ConfigValidationError;
pub use error::PerfgateError;

Modules§

baseline_service
Baseline service wire contracts.
config
Configuration file helpers and re-exports.
error
Unified error types for the perfgate ecosystem.
fingerprint
Deterministic SHA-256 fingerprints for perfgate receipts and findings.
validation
Validation functions for benchmark names and configuration.

Structs§

AggregateInput
AggregateReceipt
AggregateRunnerMeta
AggregateVerdict
BaselineServerConfig
Configuration for the baseline server connection.
BenchConfigFile
BenchMeta
Budget
BudgetOverride
Capability
A capability with its status and optional reason.
ChangedFilesSummary
CompareReceipt
A versioned receipt comparing baseline vs current (perfgate.compare.v1).
CompareRef
ComplexityGateResult
Optional complexity-gating result attached to reports.
ConfigFile
Top-level configuration file (perfgate.toml).
DecisionArtifactIndex
A manifest for the artifacts produced by perfgate decision evaluate.
DecisionBundleArtifact
One artifact embedded in a portable decision bundle.
DecisionBundleMetadata
Metadata captured when exporting a portable decision bundle.
DecisionBundleReceipt
A portable receipt bundle for structured performance decisions.
DecisionPolicyConfig
Policy for automated structured decisions.
DefaultsConfig
Delta
F64Summary
FailIfNOfM
FindingData
Data associated with a metric finding.
HostInfo
HostMismatchInfo
Details about a detected host mismatch between baseline and current runs.
NoiseDiagnostics
Diagnostics about noise in paired benchmark measurements.
OtelSpanIdentifiers
PairedBenchMeta
PairedDiffSummary
PairedRunReceipt
PairedSample
PairedSampleHalf
PairedStats
PerfgateReport
A performance report wrapping compare results in a cockpit-compatible envelope.
ProbeCompareObservation
Comparison evidence for one named probe.
ProbeCompareReceipt
A versioned receipt for named probe deltas (perfgate.probe_compare.v1).
ProbeMetricValue
A numeric metric observed for a named probe.
ProbeObservation
One named probe observation from external instrumentation.
ProbeReceipt
A versioned receipt for named probe observations (perfgate.probe.v1).
RatchetChange
Per-metric ratchet change.
RatchetConfig
Configuration for conservative automated budget ratcheting.
RatchetReceipt
Machine-readable ratchet artifact.
RepairContextReceipt
A machine-readable failure package for automated triage.
RepairGitMetadata
RepairMetricBreach
ReportFinding
A single finding from the performance check.
ReportSummary
Summary counts and key metrics for the report.
RunMeta
RunReceipt
A versioned receipt from a single benchmark run (perfgate.run.v1).
Sample
ScalingConfig
Configuration for computational complexity validation.
ScenarioComponent
A scenario component such as one benchmark, phase, or probe group.
ScenarioConfigFile
Weighted scenario definition for workload-level evaluation.
ScenarioMeta
Scenario definition captured in a scenario evaluation receipt.
ScenarioReceipt
A versioned receipt for weighted workload scenarios (perfgate.scenario.v1).
SensorArtifact
An artifact produced by the sensor.
SensorCapabilities
Capabilities available to the sensor.
SensorFinding
A finding from the sensor.
SensorReport
The sensor.report.v1 envelope for cockpit integration.
SensorRunMeta
Run metadata for the sensor report.
SensorVerdict
Verdict for the sensor report.
SensorVerdictCounts
Verdict counts for the sensor report.
Significance
SignificancePolicy
Policy for statistical significance testing.
Stats
Aggregated statistics for a benchmark run.
ToolInfo
TradeoffAllowance
A local regression allowance used by a tradeoff rule.
TradeoffAllowanceOutcome
Evaluation result for one local regression allowance.
TradeoffDecision
Final structured tradeoff decision.
TradeoffProbeOutcome
Probe-level tradeoff evidence.
TradeoffReceipt
A versioned receipt explaining accepted or rejected tradeoffs (perfgate.tradeoff.v1).
TradeoffRequirement
A required improvement used by a tradeoff rule.
TradeoffRequirementOutcome
Evaluation result for one tradeoff requirement.
TradeoffRule
A structured tradeoff rule for explicit, auditable budget downgrades.
TradeoffRuleOutcome
Evaluation result for one named tradeoff rule.
U64Summary
Verdict
Overall verdict for a comparison, with pass/warn/fail counts.
VerdictCounts

Enums§

AggregateWeightMode
Weighting mode for runner-aware aggregate verdicts.
AggregationPolicy
Fleet-level aggregation policy for matrix CI gating.
CapabilityStatus
Capability status for “No Green By Omission” principle.
ComplexityGateStatus
Complexity gate status produced by scaling validation.
DecisionBundleArtifactContent
Embedded artifact content.
DecisionBundleArtifactKind
Kind of artifact embedded in a portable decision bundle.
Direction
HostMismatchPolicy
Policy for handling host mismatches when comparing receipts from different machines.
Metric
MetricStatistic
MetricStatus
MissingNoisePolicy
How to handle missing noise evidence when low-noise tradeoff acceptance is required.
NoiseLevel
Noise level classification for paired benchmark results.
NoisePolicy
ProbeScope
Scope of a named performance probe inside a workload.
RatchetMode
How ratcheting should update budgets.
ReadJsonError
Error returned by read_json_file.
SensorSeverity
Severity level for sensor findings (cockpit vocabulary).
SensorVerdictStatus
Verdict status for the sensor report.
Severity
Severity level for a finding.
SignificanceTest
TradeoffDecisionStatus
Outcome of a tradeoff policy decision.
TradeoffDowngrade
Target status when a tradeoff rule is satisfied.
VerdictStatus

Constants§

AGGREGATE_SCHEMA_V1
BASELINE_REASON_NO_BASELINE
BASELINE_SCHEMA_V1
CHECK_ID_BASELINE
CHECK_ID_BUDGET
CHECK_ID_COMPLEXITY
CHECK_ID_HOST
CHECK_ID_TOOL_RUNTIME
CHECK_ID_TOOL_TRUNCATION
COMPARE_SCHEMA_V1
CONFIG_SCHEMA_V1
DECISION_BUNDLE_SCHEMA_V1
DECISION_INDEX_SCHEMA_V1
ERROR_KIND_EXEC
ERROR_KIND_IO
ERROR_KIND_PARSE
FINDING_CODE_BASELINE_MISSING
FINDING_CODE_COMPLEXITY_FAIL
FINDING_CODE_COMPLEXITY_INCONCLUSIVE
FINDING_CODE_HOST_MISMATCH
FINDING_CODE_METRIC_FAIL
FINDING_CODE_METRIC_WARN
FINDING_CODE_RUNTIME_ERROR
FINDING_CODE_TRUNCATED
MAX_FINDINGS_DEFAULT
PAIRED_SCHEMA_V1
PROBE_COMPARE_SCHEMA_V1
PROBE_SCHEMA_V1
RATCHET_SCHEMA_V1
REPAIR_CONTEXT_SCHEMA_V1
REPORT_SCHEMA_V1
RUN_SCHEMA_V1
SCENARIO_SCHEMA_V1
SENSOR_REPORT_SCHEMA_V1
STAGE_BASELINE_RESOLVE
STAGE_CONFIG_PARSE
STAGE_RUN_COMMAND
STAGE_WRITE_ARTIFACTS
TRADEOFF_SCHEMA_V1
VERDICT_REASON_COMPLEXITY_EXPECTED_EXCEEDED
VERDICT_REASON_COMPLEXITY_FIT_LOW_CONFIDENCE
VERDICT_REASON_COMPLEXITY_MEASUREMENT_INCOMPLETE
VERDICT_REASON_HOST_MISMATCH
VERDICT_REASON_NO_BASELINE
VERDICT_REASON_TOOL_ERROR
VERDICT_REASON_TRADEOFF_MISSING_REQUIRED_METRIC
VERDICT_REASON_TRADEOFF_REVIEW_REQUIRED
VERDICT_REASON_TRADEOFF_RULE_NOT_SATISFIED
VERDICT_REASON_TRUNCATED

Functions§

read_json_file
Reads a JSON file from disk and deserializes it into T.