CMLDEV-1207: expose per-node QUEUED/STARTED/BOOTED times in PCL#225
Merged
tmikuska merged 1 commit intoMay 12, 2026
Merged
Conversation
The Python Client Library was discarding the `times` block from
`/labs/{id}/simulation_stats`, so callers had no way to ask
"how long has this node been booted?" -- see #87.
Changes:
* Lab.sync_statistics now stores the controller's `times` dict
alongside cpu_usage / disk_read / disk_write.
* Node gains `times`, `boot_time`, `started_time`, `queued_time`
properties. The convenience properties return 0 when the node has
not reached that state, matching the controller's own convention.
* Lab gains `uptime`: smallest Node.started_time across the lab's
nodes, useful as an abandoned-lab signal. Returns 0 if any node
is not running (including the empty-lab case).
* Drive-by: keep the defensive `_get_element_from_data` reads for
`cpu_usage` / `block0_*` so partial payloads from external
connectors, unmanaged switches, and queued nodes (which only
carry `times` + `is_running`) don't blow up sync_statistics on
v2.9 / v2.10 servers either.
Tests cover the new properties, the partial-payload case, and the
uptime aggregation.
63436c8 to
9a800a0
Compare
virlos
approved these changes
May 12, 2026
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.
The Python Client Library was discarding the
timesblock from/labs/{id}/simulation_stats, so callers had no way to ask "how long has this node been booted?" -- see #87.Changes:
timesdict alongside cpu_usage / disk_read / disk_write.times,boot_time,started_time,queued_timeproperties. The convenience properties return 0 when the node has not reached that state, matching the controller's own convention.uptime: smallest non-zero STARTED marker across all nodes, useful as an abandoned-lab signal. Returns 0 when no node has started._get_element_from_datareads forcpu_usage/block0_*so partial payloads from external connectors, unmanaged switches, and queued nodes (which only carrytimes+is_running) don't blow up sync_statistics on v2.9 / v2.10 servers either.Tests cover the new properties, the partial-payload case, and the uptime aggregation.