Skip to content

Commit 7f52f1e

Browse files
fix(asap-tools): harden benchmark path and planner docs
1 parent 4534e74 commit 7f52f1e

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

‎docs/03-how-to-guides/operations/try-asap-planner-promql.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ auto-infer label sets per metric.
4646
`accuracy_sla` and `latency_sla` are required by the config schema but not currently used by
4747
the planner's decision logic — any numeric values are fine (e.g. the placeholders above).
4848

49-
### Choosing `repetition_delay_ms` and `--prometheus_scrape_interval_ms`
49+
### Choosing `repetition_delay_ms` and `--data-ingestion-interval-ms`
5050

51-
- `--prometheus_scrape_interval_ms` is your actual Prometheus scrape interval — a fact about your
51+
- `--data-ingestion-interval-ms` is your actual Prometheus scrape interval — a fact about your
5252
existing setup, not something to tune.
5353
- `repetition_delay_ms` is how often this specific query actually re-runs — e.g. `300000` for a
5454
dashboard panel refreshing every 5 minutes, or an alert rule's `evaluation_interval`.
5555
- Unlike SQL mode, there's no hard error if `repetition_delay_ms` isn't a multiple of the scrape
5656
interval, but `rate`/`increase`/`quantile_over_time` queries need at least 60 scraped data
5757
points per repeat window to be considered worth accelerating when `--enable-punting` is set —
58-
i.e. `repetition_delay_ms >= 60 * prometheus_scrape_interval_ms`.
58+
i.e. `repetition_delay_ms >= 60 * data_ingestion_interval_ms`.
5959

6060
## 3. Run the planner
6161

‎tools/run_metrics_observability_benchmark.py‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,7 @@ def main():
186186
parser.add_argument("--repetition-interval-ms", type=int, default=1000)
187187
parser.add_argument("--top", type=int, default=3)
188188
args = parser.parse_args()
189-
root = (
190-
args.queries_dir
191-
or Path(__file__).resolve().parents[4]
192-
/ "benchmarks/metrics_observability/queries"
193-
)
194-
if not root.is_dir():
195-
raise SystemExit(f"benchmark directory not found: {root}")
189+
root = args.queries_dir or find_default_queries_dir()
196190

197191
repo = Path(__file__).resolve().parents[1]
198192
binary_dir = repo / "target/release"
@@ -338,5 +332,13 @@ def make_report(all_queries, eligible_queries, parsed, planned, missing, top):
338332
return "\n".join(lines) + "\n"
339333

340334

335+
def find_default_queries_dir():
336+
for ancestor in Path(__file__).resolve().parents:
337+
candidate = ancestor / "benchmarks/metrics_observability/queries"
338+
if candidate.is_dir():
339+
return candidate
340+
raise SystemExit("benchmark directory not found; pass --queries-dir explicitly")
341+
342+
341343
if __name__ == "__main__":
342344
main()

0 commit comments

Comments
 (0)