feat(agent): read the server each 10 seconds and send the peaks of the minute - #46
Merged
Merged
Conversation
nabil1440
added this pull request to stack #38
September 24, 2026 06:06
nabil1440
marked this pull request as ready for review
September 24, 2026 06:07
…e minute Contract v0.4.0, "The readings" and "The peaks": cpu_max_percent, memory_used_max_bytes, swap_used_max_bytes and the two network peaks. The fields of v0.3.1 do not change. apt-check now runs after the reading of the tick, so that it does not move the reading. Closes #41
…by the real reading times - A reading that ends at or after the next tick no longer skips it. - Each reading, and the tick reading, carries the time at which it ran (with the monotonic clock), so a late timer or a step of the wall clock does not change the length of a window. recorded_at stays the tick. - cpu_max_percent leaves out the windows of an older minute whose tick failed, as the memory peaks do.
After a fresh start (no saved counters), the first tick can come some milliseconds after the start reading: its CPU value is the load of the start, for example 100% during an install. That minute now has no sample, and the tick reading starts the next minute, which then has all its values. The agent logs it at Info, not as a warning.
nabil1440
force-pushed
the
agent/41-peaks
branch
from
September 24, 2026 08:09
c3cf4d6 to
f062b24
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.
Closes #41.
Part of the monitoring agent stack. This PR is on top of #40. Contract v0.4.0, "The readings" and "The peaks".
What changes
Tuses the windows from one reading to the next, from the tick before toT. If a reading fails, the two windows on each side of it join into one. A reading less than 5 seconds from its neighbours is left out, so that no window is some milliseconds long.cpu_max_percent,memory_used_max_bytes,swap_used_max_bytes,net_in_max_bytes_per_secondandnet_out_max_bytes_per_second. A value that is not known isnull.cpu_percent ≤ cpu_max_percent,memory_used_bytes ≤ memory_used_max_bytes ≤ memory_total_bytes, the same for swap, andnet_in_bytes ≤ 60 × net_in_max_bytes_per_secondup to rounding.nullwhennet_counters_resetis true, or when a counter of a window went back.recorded_atstays the time of the tick.Before release
Tests
null.make checkpasses.