diff --git a/plugins/inputs/win_perf_counters/pdh_386.go b/plugins/inputs/win_perf_counters/pdh_386.go index d1e3aafbf9fc2..feb085078a54c 100644 --- a/plugins/inputs/win_perf_counters/pdh_386.go +++ b/plugins/inputs/win_perf_counters/pdh_386.go @@ -33,48 +33,34 @@ package win_perf_counters // pdhFmtCountervalueDouble is a union specialization for double values -type PdhFmtCountervalueDouble struct { +type pdhFmtCountervalueDouble struct { CStatus uint32 padding [4]byte DoubleValue float64 } -// pdhFmtCountervalueLarge is a union specialization for 64-bit integer values -type PdhFmtCountervalueLarge struct { - CStatus uint32 - padding [4]byte //nolint:unused // Memory reservation - LargeValue int64 -} - // pdhFmtCountervalueLong is a union specialization for long values -type PdhFmtCountervalueLong struct { +type pdhFmtCountervalueLong struct { CStatus uint32 LongValue int32 padding [4]byte //nolint:unused // Memory reservation } -type PdhFmtCountervalueItemDouble struct { +type pdhFmtCountervalueItemDouble struct { SzName *uint16 padding [4]byte //nolint:unused // Memory reservation - FmtValue PdhFmtCountervalueDouble -} - -// pdhFmtCountervalueItemLarge is a union specialization for 'large' values, used by PdhGetFormattedCounterArrayLarge() -type PdhFmtCountervalueItemLarge struct { - SzName *uint16 // pointer to a string - padding [4]byte //nolint:unused // Memory reservation - FmtValue PdhFmtCountervalueLarge + FmtValue pdhFmtCountervalueDouble } // pdhFmtCountervalueItemLong is a union specialization for long values, used by PdhGetFormattedCounterArrayLong() type PdhFmtCountervalueItemLong struct { SzName *uint16 // pointer to a string padding [4]byte //nolint:unused // Memory reservation - FmtValue PdhFmtCountervalueLong + FmtValue pdhFmtCountervalueLong } // pdhCounterInfo structure contains information describing the properties of a counter. This information also includes the counter path. -type PdhCounterInfo struct { +type pdhCounterInfo struct { //Size of the structure, including the appended strings, in bytes. DwLength uint32 //Counter type. For a list of counter types, see the Counter Types section of the @@ -124,7 +110,7 @@ type PdhCounterInfo struct { // The pdhRawCounter structure returns the data as it was collected from the counter provider. No translation, formatting, // or other interpretation is performed on the data -type PdhRawCounter struct { +type pdhRawCounter struct { // Counter status that indicates if the counter value is valid. Check this member before using the data in a calculation or displaying its value. // For a list of possible values, see https://docs.microsoft.com/windows/desktop/PerfCtrs/checking-pdh-interface-return-values CStatus uint32 @@ -139,9 +125,9 @@ type PdhRawCounter struct { MultiCount uint32 } -type PdhRawCounterItem struct { +type pdhRawCounterItem struct { // Pointer to a null-terminated string that specifies the instance name of the counter. The string is appended to the end of this structure. SzName *uint16 //A pdhRawCounter structure that contains the raw counter value of the instance - RawValue PdhRawCounter + RawValue pdhRawCounter } diff --git a/plugins/inputs/win_perf_counters/pdh_amd64.go b/plugins/inputs/win_perf_counters/pdh_amd64.go index 0401d83714407..82630966d8fc2 100644 --- a/plugins/inputs/win_perf_counters/pdh_amd64.go +++ b/plugins/inputs/win_perf_counters/pdh_amd64.go @@ -38,37 +38,12 @@ type pdhFmtCountervalueDouble struct { DoubleValue float64 } -// pdhFmtCountervalueLarge is a union specialization for 64-bit integer values -type pdhFmtCountervalueLarge struct { - CStatus uint32 - LargeValue int64 -} - -// pdhFmtCountervalueLong is a union specialization for long values -type pdhFmtCountervalueLong struct { - CStatus uint32 - LongValue int32 - padding [4]byte //nolint:unused // Memory reservation -} - // pdhFmtCountervalueItemDouble is a union specialization for double values, used by PdhGetFormattedCounterArrayDouble type pdhFmtCountervalueItemDouble struct { SzName *uint16 FmtValue pdhFmtCountervalueDouble } -// pdhFmtCountervalueItemLarge is a union specialization for 'large' values, used by PdhGetFormattedCounterArrayLarge() -type pdhFmtCountervalueItemLarge struct { - SzName *uint16 // pointer to a string - FmtValue pdhFmtCountervalueLarge -} - -// pdhFmtCountervalueItemLong is a union specialization for long values, used by PdhGetFormattedCounterArrayLong() -type pdhFmtCountervalueItemLong struct { - SzName *uint16 // pointer to a string - FmtValue pdhFmtCountervalueLong -} - // pdhCounterInfo structure contains information describing the properties of a counter. This information also includes the counter path. type pdhCounterInfo struct { //Size of the structure, including the appended strings, in bytes. diff --git a/plugins/inputs/win_perf_counters/pdh_arm64.go b/plugins/inputs/win_perf_counters/pdh_arm64.go index 35840af3764a7..338d9975cbb73 100644 --- a/plugins/inputs/win_perf_counters/pdh_arm64.go +++ b/plugins/inputs/win_perf_counters/pdh_arm64.go @@ -33,43 +33,18 @@ package win_perf_counters // pdhFmtCountervalueDouble is a union specialization for double values -type PdhFmtCountervalueDouble struct { +type pdhFmtCountervalueDouble struct { CStatus uint32 DoubleValue float64 } -// pdhFmtCountervalueLarge is a union specialization for 64-bit integer values -type PdhFmtCountervalueLarge struct { - CStatus uint32 - LargeValue int64 -} - -// pdhFmtCountervalueLong is a union specialization for long values -type PdhFmtCountervalueLong struct { - CStatus uint32 - LongValue int32 - padding [4]byte //nolint:unused // Memory reservation -} - -type PdhFmtCountervalueItemDouble struct { +type pdhFmtCountervalueItemDouble struct { SzName *uint16 - FmtValue PdhFmtCountervalueDouble -} - -// pdhFmtCountervalueItemLarge is a union specialization for 'large' values, used by PdhGetFormattedCounterArrayLarge() -type PdhFmtCountervalueItemLarge struct { - SzName *uint16 // pointer to a string - FmtValue PdhFmtCountervalueLarge -} - -// pdhFmtCountervalueItemLong is a union specialization for long values, used by PdhGetFormattedCounterArrayLong() -type PdhFmtCountervalueItemLong struct { - SzName *uint16 // pointer to a string - FmtValue PdhFmtCountervalueLong + FmtValue pdhFmtCountervalueDouble } // pdhCounterInfo structure contains information describing the properties of a counter. This information also includes the counter path. -type PdhCounterInfo struct { +type pdhCounterInfo struct { //Size of the structure, including the appended strings, in bytes. DwLength uint32 //Counter type. For a list of counter types, see the Counter Types section @@ -117,7 +92,7 @@ type PdhCounterInfo struct { // The pdhRawCounter structure returns the data as it was collected from the counter provider. // No translation, formatting, or other interpretation is performed on the data. -type PdhRawCounter struct { +type pdhRawCounter struct { // Counter status that indicates if the counter value is valid. Check this member before using the data in a calculation or displaying its value. // For a list of possible values, see https://docs.microsoft.com/windows/desktop/PerfCtrs/checking-pdh-interface-return-values CStatus uint32 @@ -132,9 +107,9 @@ type PdhRawCounter struct { MultiCount uint32 } -type PdhRawCounterItem struct { +type pdhRawCounterItem struct { // Pointer to a null-terminated string that specifies the instance name of the counter. The string is appended to the end of this structure. SzName *uint16 //A pdhRawCounter structure that contains the raw counter value of the instance - RawValue PdhRawCounter + RawValue pdhRawCounter }