mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-13 16:36:37 +00:00
vmware: refactor collector (#1727)
This commit is contained in:
@@ -166,10 +166,12 @@ func (c *Collector) Collect() (map[string]map[string]perftypes.CounterValues, er
|
||||
metricType = prometheus.GaugeValue
|
||||
}
|
||||
|
||||
_, isTotalCounterRequests := c.counters["_Total"]
|
||||
|
||||
for _, item := range items {
|
||||
if item.RawValue.CStatus == PdhCstatusValidData || item.RawValue.CStatus == PdhCstatusNewData {
|
||||
instanceName := windows.UTF16PtrToString(item.SzName)
|
||||
if strings.HasSuffix(instanceName, "_Total") {
|
||||
if strings.HasSuffix(instanceName, "_Total") && !isTotalCounterRequests {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user