Skip to content

Tmp - #163

Closed
tmakatos wants to merge 17 commits into
mainfrom
tmp
Closed

Tmp#163
tmakatos wants to merge 17 commits into
mainfrom
tmp

Conversation

@tmakatos

Copy link
Copy Markdown
Collaborator

No description provided.

Grouping related values with '/' makes the per-VM log awkward to
process with standard tools. Separate every field with a space instead.
Missing latency renders one '-' per cell so the number of fields stays
fixed. The main log keeps the '/' grouping, since its values are keyed.

Fixes #100

Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
The aggregate status line still grouped its 1m, 5m and 15m IOPS with
'/'. Separate them with spaces, like the per-VM log.

AI-generated: everything
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Otherwise there's no way to tell from the per-VM log when the daemon
started or stopped tracking a VM, or why it stopped.

AI-generated: everything
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
refresh_state and read_cpu_sample run for every VM on every tick, and
as INFO spans they print a 'new' line each time. Demote them to DEBUG
and attach the VM ID and PID directly to the warnings they emit, which
previously relied on the span for that context.

AI-generated: everything
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
The systemd log style printed a line for every INFO span created,
including zbus's internal spans, which flooded the log with D-Bus
handshake details on start up.

AI-generated: everything
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Discovery connected to every VM's control socket on every pass, only to
read the peer PID, even for VMs already tracked. Backends that listen
with a minimal backlog reject such a connection with EAGAIN while an
earlier one is still pending, which logged a warning and dropped the VM
from that discovery pass.

Cache the peer PID per socket path and reconnect only when the socket
file is replaced or the cached process is gone. EAGAIN on a socket that
isn't cached yet is transient, so log it at debug and retry on the next
pass.

AI-generated: everything
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
The threshold engine logged per-thread utilisation as a raw fraction
with full f64 precision (e.g. util=0.9932802709036076). Log it as a
percentage with two decimals instead (e.g. util=99.33%).

AI-generated: everything
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Every per-VM event was logged twice, once through tracing and once as
a hand-formatted line for the per-VM file, and events logged elsewhere,
such as the threshold engine's scaling decisions, never reached the
per-VM file at all.

Add a tracing layer that copies every event carrying a vm field to that
VM's file, without the vm field, and log per-VM events only once. Status
and lifecycle records use a dedicated per_vm target that the main log
filters out, so they still only go to the per-VM files. The layer has
its own INFO filter, so RUST_LOG no longer affects the per-VM files.

Use vm consistently for the VM ID field, instead of id or uuid, so that
those events are routed too.

AI-generated: everything
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Durations are now integer seconds in settings ending in _secs:

  scale_poll_secs, cooldown_secs              (now integers, were floats)
  scale_down_sustain_polls                 -> scale_down_sustain_secs
  scale_validation_sample_polls            -> scale_validation_delay_secs
  scale_validation_sample_polls_per_thread -> scale_validation_delay_per_thread_secs
  post_revert_up_grace_polls               -> post_revert_up_grace_secs
  post_revert_up_recovery_polls            -> post_revert_up_recovery_secs
  post_revert_up_backoff_max_polls         -> post_revert_up_backoff_max_secs
  scale_down_backoff_max_polls             -> scale_down_backoff_max_secs

Every duration must be a multiple of scale_poll_secs. The engine
receives the poll period when it is built and converts its durations to
polls once, so engine logic is unchanged. The daemon refuses to start if
any duration, controller or engine, is not a multiple, listing all of
them with the nearest valid values.

The round_up_durations config option and --round-up-durations flag
(both off by default) instead round such durations up with a warning,
so that a new poll period can be tried without rewriting the config.
The daemon now logs the effective controller, engine, and backend
configuration at startup, which shows rounded values.

The daemon also prints errors with Display rather than Debug.

AI-generated: everything.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
@tmakatos tmakatos closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant