Run monitor continuously by default (--interval optional, 0 = back-to-back)#28
Merged
Merged
Conversation
Make --interval optional with a default of 0, which now means continuous: the next iteration starts the moment the previous one finishes. validate() rejects only negative intervals; the loop and clock need no changes because runMonitorLoop already clamps the delay to 0 and RealClock.Sleep treats a non-positive delay as a cancellation-observing no-op. --error-wait still inserts its pause after a failed iteration, so it remains the brake in continuous mode. The startup log renders interval=continuous when zero so the line stays self-explanatory; paced runs (--interval > 0) are byte-identical to today. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Christian Berendt <berendt@b42labs.com>
MONITOR_INTERVAL now defaults to 0, so `make testbed-monitor` runs iterations back-to-back and drives the local OTEL stack with a steady stream of data; MONITOR_INTERVAL=5m restores the paced behaviour. The cadence echo annotates both zeros so the line stays self-explanatory. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Christian Berendt <berendt@b42labs.com>
Reword the command synopsis (--interval now optional), the cadence semantics, and the testbed-monitor walkthrough so they lead with the new default: an omitted or 0 interval runs iterations back-to-back continuously, and --error-wait is the brake in that mode. The three Grafana dashboard sampling caveats no longer claim a 5m default — metrics flow steadily under the continuous default and only move per-iteration on a paced run. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Christian Berendt <berendt@b42labs.com>
berendt
marked this pull request as ready for review
July 2, 2026 17:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #27
What changed
Monitor mode (
neutron monitor) previously required--intervaland rejected a zero or non-positive value. This branch makes--intervaloptional with a default of0, which now means continuous: each iteration starts the moment the previous one finishes. Paced runs (--interval > 0) are unchanged.The change lands in three commits:
275de60 — Run monitor continuously by default (
--interval 0= back-to-back)cmd/openstack-tester/monitor.go: dropMarkFlagRequired("interval")so the flag is optional; its default was already0. The flag usage string now documents0 = continuous.monitorConfig.validate()now rejects only a negative interval (< 0) instead of a non-positive one (<= 0); the error message changes from "must be positive" to "must not be negative". A zero interval is valid and means back-to-back.interval=continuouswhen the interval is0, so the line stays self-explanatory; the value is otherwisecfg.interval.String().runMonitorLoop: adds aminFailureBackoff(5s) floor on the post-failure wait. In continuous mode (intervalanderror-waitboth0), a fast-failing dependency — e.g. an unreachable Keystone that refuses auth in ~1ms — would otherwise hot-loop, pinning a CPU and flooding logs; the floor makes it back off.--error-waitremains the explicit brake.018c967 — Default
testbed-monitorto a continuousMONITOR_INTERVALof 0Makefile:MONITOR_INTERVALdefault flips from5mto0, somake testbed-monitorruns iterations back-to-back and feeds the local OTEL stack a steady stream of data.MONITOR_INTERVAL=5mrestores paced behaviour. The cadence echo annotates both zeros (interval 0 (0 = continuous)) so it stays readable.7cffd7d — Document the continuous monitor default in README and dashboards
README.md: reword the command synopsis (--intervalnow optional), the cadence semantics, and thetestbed-monitorwalkthrough to lead with the new default; note that--error-waitis the brake in continuous mode.contrib/otel/dashboards/*.json: the three sampling caveats no longer claim a5mdefault, since metrics now flow steadily under the continuous default and only move per-iteration on a paced run.Tests
cmd/openstack-tester/monitor_test.gogains coverage for the new semantics (continuous pacing,validate()accepting0and rejecting negatives, and the failure-backoff floor), all driven on the injected fake clock — no cloud required.Divergence from the issue
--intervaloptional with0 = back-to-back. The implementation additionally introduces a fixed 5sminFailureBackofffloor for failed iterations, to prevent a hot-loop when both--intervaland--error-waitare0. This is a safety guard implied by "continuous by default" rather than a literal ask.minFailureBackofffloor torunMonitorLoop(documented in the function's doc comment). The message narrates the primary mechanism; the guard is the one loop change that shipped alongside it.Implemented by planwerk-agent 6b3f3ea with Claude:claude-opus-4-8