mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-30 15:39:04 +01:00
mscluster: reuse control buffers and cut per-property allocations (#2673)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
a8adb6d7bc
commit
930609b0e5
@@ -32,6 +32,12 @@
|
||||
the documentation miss this. The parser validates only the structure and
|
||||
accepts zero padding. `TestDumpPropertyLists` logs real lists as hex when
|
||||
`WINDOWS_EXPORTER_TEST_CLUSAPI_DUMP` is set on a cluster node.
|
||||
- Each `Cluster` owns one control buffer (`controlScratch`). Like the handle,
|
||||
it belongs to the running call, so calls never share it and no `sync.Pool`
|
||||
is needed. `ParseProperties` returns `Property.Data` slices into it: copy
|
||||
values out (`copyResourceProperties`, `readCommonProperties`) before the
|
||||
next control, and never keep a parsed list past that point. `get` zeroes
|
||||
the bytes, so a reused buffer reads like a new one.
|
||||
- `clusapi.Open` reports an unconfigured cluster or a missing ClusAPI with
|
||||
`errors.ErrUnsupported`; the shared collector test treats that as an
|
||||
unsupported role on hosts where `mscluster` is not a required fixture.
|
||||
|
||||
Reference in New Issue
Block a user