Skip to content

refactor: add EventSink support to overall utilization collector#387

Merged
hardy-dev-infinilabs merged 1 commit into
mainfrom
overall
Jun 30, 2026
Merged

refactor: add EventSink support to overall utilization collector#387
hardy-dev-infinilabs merged 1 commit into
mainfrom
overall

Conversation

@SteveLauC

@SteveLauC SteveLauC commented Jun 30, 2026

Copy link
Copy Markdown
Member

The overall collector used event.Save() directly, which meant callers could not redirect its events to a custom sink — unlike the other four host metric collectors (cpu, memory, disk, network) which all embed event.EventSink and expose a NewWithSink constructor.

Add the EventSink embedded field, a NewWithSink constructor, and switch Collect() from event.Save() to m.Save(). This follows the exact same pattern already established by the other host metric packages, enabling the inspect package to inject its own FileMetricSink.

Standards checklist

  • The PR title is descriptive
  • The commit messages are semantic
  • Necessary tests are added
  • Updated the release notes
  • Necessary documents have been added if this is a new feature
  • Performance tests checked, no obvious performance degradation

The overall collector used event.Save() directly, which meant callers could not
redirect its events to a custom sink — unlike the other four host metric
collectors (cpu, memory, disk, network) which all embed event.EventSink and
expose a NewWithSink constructor.

Add the EventSink embedded field, a NewWithSink constructor, and switch Collect()
from event.Save() to m.Save(). This follows the exact same pattern already
established by the other host metric packages, enabling the inspect package
to inject its own FileMetricSink.
@hardy-dev-infinilabs hardy-dev-infinilabs merged commit 4b38159 into main Jun 30, 2026
4 checks passed
@hardy-dev-infinilabs hardy-dev-infinilabs deleted the overall branch June 30, 2026 08:33
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.

3 participants