mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-17 18:19:04 +02: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
@@ -95,7 +95,7 @@ func (c *Cluster) readResourcePartitions(name objectName, deadline time.Time) (_
|
||||
}
|
||||
}()
|
||||
|
||||
data, err := resourceBuffer(handle, resourceGetClassInfo, 8, deadline)
|
||||
data, err := c.scratch.resourceControl(handle, resourceGetClassInfo, 8, deadline)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("class information: %w", err)
|
||||
}
|
||||
@@ -104,7 +104,7 @@ func (c *Cluster) readResourcePartitions(name objectName, deadline time.Time) (_
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
data, err = resourceBuffer(handle, resourceStorageGetDiskInfoEx, propertyListBufferSize, deadline)
|
||||
data, err = c.scratch.resourceControl(handle, resourceStorageGetDiskInfoEx, propertyListBufferSize, deadline)
|
||||
if errors.Is(err, windows.ERROR_INVALID_FUNCTION) || errors.Is(err, windows.ERROR_NOT_SUPPORTED) {
|
||||
// Storage class resources such as storage pools have no disk layout.
|
||||
return nil, nil
|
||||
|
||||
Reference in New Issue
Block a user