pub fn normalize(file: ScenarioFile) -> Result<NormalizedFile, NormalizeError>Expand description
Resolve the defaults: block into every entry of a parsed v2 scenario
file.
The returned NormalizedFile contains a NormalizedEntry per input
entry with the following fields materialized:
rateinherits fromdefaults.ratewhen the entry omits it; missing on both is an error (seeNormalizeError::MissingRate).durationinherits fromdefaults.duration; absence is preserved as “run until stopped”.encoderinherits fromdefaults.encoder, otherwise defaults toprometheus_textfor metrics/histogram/summary andjson_linesfor logs.sinkinherits fromdefaults.sink, otherwise defaults tostdout.labels— inline entries only: the union ofdefaults.labelsand the entry’s labels (entry wins on conflict). Pack entries keep their own labels unchanged;defaults.labelsis surfaced onNormalizedFile::defaults_labelsfor Phase 3 pack expansion.
All other fields (pack info, histogram parameters, after clause,
phase_offset, clock_group, jitter, gaps, bursts, cardinality spikes,
dynamic labels, etc.) are carried through untouched.
§Errors
Returns NormalizeError::MissingRate when an entry has no rate
defined inline and the defaults: block does not supply one either.
The error message identifies the entry by index and, when available,
its name, id, or pack reference.