mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-28 23:56:36 +00:00
Harmonize query call layout
This commit is contained in:
@@ -56,7 +56,8 @@ type Win32_ComputerSystem struct {
|
|||||||
|
|
||||||
func (c *CSCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *CSCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_ComputerSystem
|
var dst []Win32_ComputerSystem
|
||||||
if err := wmi.Query(queryAll(&dst), &dst); err != nil {
|
q := queryAll(&dst)
|
||||||
|
if err := wmi.Query(q, &dst); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ type HyperVCollector struct {
|
|||||||
|
|
||||||
// Win32_PerfRawData_Counters_HyperVVirtualStorageDevice
|
// Win32_PerfRawData_Counters_HyperVVirtualStorageDevice
|
||||||
VMStorageErrorCount *prometheus.Desc
|
VMStorageErrorCount *prometheus.Desc
|
||||||
VMStorageQueueLength *prometheus.Desc
|
VMStorageQueueLength *prometheus.Desc
|
||||||
VMStorageReadBytes *prometheus.Desc
|
VMStorageReadBytes *prometheus.Desc
|
||||||
VMStorageReadOperations *prometheus.Desc
|
VMStorageReadOperations *prometheus.Desc
|
||||||
VMStorageWriteBytes *prometheus.Desc
|
VMStorageWriteBytes *prometheus.Desc
|
||||||
@@ -657,7 +657,8 @@ type Win32_PerfRawData_VmmsVirtualMachineStats_HyperVVirtualMachineHealthSummary
|
|||||||
|
|
||||||
func (c *HyperVCollector) collectVmHealth(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *HyperVCollector) collectVmHealth(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_PerfRawData_VmmsVirtualMachineStats_HyperVVirtualMachineHealthSummary
|
var dst []Win32_PerfRawData_VmmsVirtualMachineStats_HyperVVirtualMachineHealthSummary
|
||||||
if err := wmi.Query(queryAll(&dst), &dst); err != nil {
|
q := queryAll(&dst)
|
||||||
|
if err := wmi.Query(q, &dst); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -689,7 +690,8 @@ type Win32_PerfRawData_VidPerfProvider_HyperVVMVidPartition struct {
|
|||||||
|
|
||||||
func (c *HyperVCollector) collectVmVid(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *HyperVCollector) collectVmVid(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_PerfRawData_VidPerfProvider_HyperVVMVidPartition
|
var dst []Win32_PerfRawData_VidPerfProvider_HyperVVMVidPartition
|
||||||
if err := wmi.Query(queryAll(&dst), &dst); err != nil {
|
q := queryAll(&dst)
|
||||||
|
if err := wmi.Query(q, &dst); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -752,7 +754,8 @@ type Win32_PerfRawData_HvStats_HyperVHypervisorRootPartition struct {
|
|||||||
|
|
||||||
func (c *HyperVCollector) collectVmHv(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *HyperVCollector) collectVmHv(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_PerfRawData_HvStats_HyperVHypervisorRootPartition
|
var dst []Win32_PerfRawData_HvStats_HyperVHypervisorRootPartition
|
||||||
if err := wmi.Query(queryAll(&dst), &dst); err != nil {
|
q := queryAll(&dst)
|
||||||
|
if err := wmi.Query(q, &dst); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -889,7 +892,8 @@ type Win32_PerfRawData_HvStats_HyperVHypervisor struct {
|
|||||||
|
|
||||||
func (c *HyperVCollector) collectVmProcessor(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *HyperVCollector) collectVmProcessor(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_PerfRawData_HvStats_HyperVHypervisor
|
var dst []Win32_PerfRawData_HvStats_HyperVHypervisor
|
||||||
if err := wmi.Query(queryAll(&dst), &dst); err != nil {
|
q := queryAll(&dst)
|
||||||
|
if err := wmi.Query(q, &dst); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -923,7 +927,8 @@ type Win32_PerfRawData_HvStats_HyperVHypervisorRootVirtualProcessor struct {
|
|||||||
|
|
||||||
func (c *HyperVCollector) collectHostCpuUsage(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *HyperVCollector) collectHostCpuUsage(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_PerfRawData_HvStats_HyperVHypervisorRootVirtualProcessor
|
var dst []Win32_PerfRawData_HvStats_HyperVHypervisorRootVirtualProcessor
|
||||||
if err := wmi.Query(queryAll(&dst), &dst); err != nil {
|
q := queryAll(&dst)
|
||||||
|
if err := wmi.Query(q, &dst); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -983,7 +988,8 @@ type Win32_PerfRawData_HvStats_HyperVHypervisorVirtualProcessor struct {
|
|||||||
|
|
||||||
func (c *HyperVCollector) collectVmCpuUsage(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *HyperVCollector) collectVmCpuUsage(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_PerfRawData_HvStats_HyperVHypervisorVirtualProcessor
|
var dst []Win32_PerfRawData_HvStats_HyperVHypervisorVirtualProcessor
|
||||||
if err := wmi.Query(queryAll(&dst), &dst); err != nil {
|
q := queryAll(&dst)
|
||||||
|
if err := wmi.Query(q, &dst); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1060,7 +1066,8 @@ type Win32_PerfRawData_NvspSwitchStats_HyperVVirtualSwitch struct {
|
|||||||
|
|
||||||
func (c *HyperVCollector) collectVmSwitch(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *HyperVCollector) collectVmSwitch(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_PerfRawData_NvspSwitchStats_HyperVVirtualSwitch
|
var dst []Win32_PerfRawData_NvspSwitchStats_HyperVVirtualSwitch
|
||||||
if err := wmi.Query(queryAll(&dst), &dst); err != nil {
|
q := queryAll(&dst)
|
||||||
|
if err := wmi.Query(q, &dst); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1218,7 +1225,8 @@ type Win32_PerfRawData_EthernetPerfProvider_HyperVLegacyNetworkAdapter struct {
|
|||||||
|
|
||||||
func (c *HyperVCollector) collectVmEthernet(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *HyperVCollector) collectVmEthernet(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_PerfRawData_EthernetPerfProvider_HyperVLegacyNetworkAdapter
|
var dst []Win32_PerfRawData_EthernetPerfProvider_HyperVLegacyNetworkAdapter
|
||||||
if err := wmi.Query(queryAll(&dst), &dst); err != nil {
|
q := queryAll(&dst)
|
||||||
|
if err := wmi.Query(q, &dst); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1287,7 +1295,8 @@ type Win32_PerfRawData_Counters_HyperVVirtualStorageDevice struct {
|
|||||||
|
|
||||||
func (c *HyperVCollector) collectVmStorage(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *HyperVCollector) collectVmStorage(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_PerfRawData_Counters_HyperVVirtualStorageDevice
|
var dst []Win32_PerfRawData_Counters_HyperVVirtualStorageDevice
|
||||||
if err := wmi.Query(queryAll(&dst), &dst); err != nil {
|
q := queryAll(&dst)
|
||||||
|
if err := wmi.Query(q, &dst); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1355,7 +1364,8 @@ type Win32_PerfRawData_NvspNicStats_HyperVVirtualNetworkAdapter struct {
|
|||||||
|
|
||||||
func (c *HyperVCollector) collectVmNetwork(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *HyperVCollector) collectVmNetwork(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_PerfRawData_NvspNicStats_HyperVVirtualNetworkAdapter
|
var dst []Win32_PerfRawData_NvspNicStats_HyperVVirtualNetworkAdapter
|
||||||
if err := wmi.Query(queryAll(&dst), &dst); err != nil {
|
q := queryAll(&dst)
|
||||||
|
if err := wmi.Query(q, &dst); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,8 @@ type Win32_OperatingSystem struct {
|
|||||||
|
|
||||||
func (c *OSCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *OSCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_OperatingSystem
|
var dst []Win32_OperatingSystem
|
||||||
if err := wmi.Query(queryAll(&dst), &dst); err != nil {
|
q := queryAll(&dst)
|
||||||
|
if err := wmi.Query(q, &dst); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,8 @@ type Win32_PerfRawData_PerfOS_System struct {
|
|||||||
|
|
||||||
func (c *SystemCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *SystemCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
var dst []Win32_PerfRawData_PerfOS_System
|
var dst []Win32_PerfRawData_PerfOS_System
|
||||||
if err := wmi.Query(queryAll(&dst), &dst); err != nil {
|
q := queryAll(&dst)
|
||||||
|
if err := wmi.Query(q, &dst); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user