asonnino/mysticeti

orchestrator: duration fields use three inconsistent serde formats

Open

#183 opened on Jun 15, 2026

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Rust (14 forks)auto 404
good first issueorchestrator

Repository metrics

Stars
 (16 stars)
PR merge metrics
 (PR metrics pending)

Description

Problem

Duration/time fields across the orchestrator config files use three different serde encodings, so a user editing the config has to remember a different syntax per field. All three appear in files a user routinely touches (settings.yml, client-parameters.yml, node-parameters.yml):

Style Encoding Example field(s) YAML syntax
1. DurationSeconds (serde_with) integer seconds Settings::benchmark_duration, scrape_interval, ssh_timeout, health_check_timeout (crates/orchestrator/src/settings.rs) benchmark_duration: 300
2. humantime_serde human string LoadGeneratorConfig::initial_delay (crates/replica/src/config.rs) initial_delay: 30s
3. default Duration serde {secs, nanos} struct DagParameters::round_timeout (crates/dag/src/config.rs) round_timeout: {secs: 1, nanos: 0}

So a 1-second value is written three different ways depending on the field: 1 (as part of seconds), 1s, or {secs: 1, nanos: 0}. This is confusing and error-prone (e.g. easy to write benchmark_duration: 30s and have it fail, or expect round_timeout: 1).

Suggested fix

Standardize on humantime_serde everywhere a Duration is configured — it is the most readable and unambiguous (300s, 30s, 1s, 500ms) and round-trips cleanly. Concretely:

  • Replace the #[serde_as(as = "DurationSeconds")] fields in Settings with #[serde(with = "humantime_serde")].
  • Replace the default Duration serde on DagParameters::round_timeout (and any other struct-form durations) with humantime_serde (use humantime_serde::option for the Option<Duration>).
  • Update the asset templates and docs accordingly.

Alternatively, pick any single style — the key is consistency.

Found while setting up multi-region benchmark configs.

Contributor guide