Repository navigation
Add service runtime statistics and table formatting framework - #1299
Merged
Merged
Conversation
rical
force-pushed
the
statd-add-service-stat
branch
2 times, most recently
from
December 2, 2025 16:43
4f60230 to
9a26231
Compare
wkz
requested changes
Dec 4, 2025
wkz
left a comment
Contributor
There was a problem hiding this comment.
This looks great!
Don't these changes depend on the addition of memory stats to initctl -j though?
Contributor
Author
Thanks!
Yes and no. The code handles it gracefully if those stats aren't there yet, so it won't break anything. I wrote it this way intentionally so we could merge this without waiting for the finit upgrade that adds the memory counters. Basically wanted to keep this decoupled from the buildroot update. |
Contributor
Author
|
@wkz Can we merge this in its current state? As I mentioned above, the fact that finit don't support mem counters yet should not break anything. |
Add statistics container to service model with memory usage, uptime, and restart count tracking. Updates YANG revision to 2025-12-02. Signed-off-by: Richard Alpe <[email protected]>
Populate operational runtime statistics for services. Signed-off-by: Richard Alpe <[email protected]>
Replace manual f-string formatting with SimpleTable/Column classes. This new "framework" handles ANSI colors and padding. Removing the hassle of manually calculating padding. You simply specify the header with max number of chars the data can be and if you want left/right padding and the "framework" calculates the padding for you. We use this new "framework" to pretty print the newly added services statistics. Signed-off-by: Richard Alpe <[email protected]>
Signed-off-by: Richard Alpe <[email protected]>
Contributor
- Remove fixed lengths from Column class - Add dynamic width calculation to SimpleTable - Update service table to use new batched printing Signed-off-by: Richard Alpe <[email protected]>
rical
force-pushed
the
statd-add-service-stat
branch
from
December 18, 2025 09:53
9a26231 to
faebf70
Compare
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.
Description
Add service runtime statistics monitoring with memory usage, uptime, and restart counts. Includes a new SimpleTable framework for clean CLI formatting that handles ANSI colors correctly.
TODO
I realise now that I want to improve the SimpleTable() class to dynamically space columns based on added data. But I submit this as is because I don't want to risk leaving it dangling. Basically it works fine as it is but it can be improved (as always).
Checklist
Tick relevant boxes, this PR is-a or has-a: