Skip to content

feature: Send the peaks within each minute #41

Closed

Description

@nabil1440

Blocker: no. This can wait until the agent stack is merged. It goes on top of #39 in the same stack.

Part of contract v0.4.0, section "2026-09-24 — Peaks, pressure and disk activity": "The readings" and "The peaks".

Defect

  • The agent reads the server one time each minute, at the tick.
  • cpu_percent and the network traffic are values for the whole minute. A short spike becomes an average: 10 seconds at 100% CPU and 50 seconds idle send about 17%.
  • The memory and swap values come from one moment. A spike between two ticks is not visible.

Cost

  • A minute chart does not show the peaks within the minute.
  • A person cannot see why a site was slow for some seconds.

Benefit of the fix

  • The agent reads the server each 10 seconds. It still sends one sample for each minute.
  • Each sample carries the highest 10-second value of the minute. The fields of contract v0.3.1 do not change, so the alerts do not change.

Fix

  1. Read the server at the tick and each 10 seconds after the tick: six readings for each minute.
  2. Keep each 10-second window, from one reading to the next. If a reading fails, join the two windows on each side of it.
  3. Add the optional sample fields cpu_max_percent, memory_used_max_bytes, swap_used_max_bytes, net_in_max_bytes_per_second and net_out_max_bytes_per_second.
  4. Send null for the network peaks when net_counters_reset is true, or when a counter of a window went back.
  5. Make sure that each peak is not less than the value of the minute.
  6. Before a dev release sends the new fields, send one report to a control plane of contract v0.3.1. Make sure that the answer is 200, not 400.

Completion checks

  • The agent reads the server six times each minute, and sends one sample each minute.
  • A reading that fails joins two windows. The sample still goes.
  • The first sample after a start has peaks equal to the values of the minute.
  • cpu_percent ≤ cpu_max_percent, memory_used_bytes ≤ memory_used_max_bytes ≤ memory_total_bytes, and the same for swap.
  • A control plane of contract v0.3.1 accepts a sample with the new fields.

Activity

  1. self-assigned this
    on Sep 24, 2026
  2. added a commit that references this issue on Sep 28, 2026
    6a8ff9a
  3. changed the title [-]Send the peaks within each minute[/-] [+]feature: Send the peaks within each minute[/+] on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions