-
Notifications
You must be signed in to change notification settings - Fork 680
Prometheus and WMI CounterTypes
Calle Pettersson edited this page Sep 3, 2016
·
5 revisions
WMI performance counters have many types, and those need to be mapped to Prometheus' types. Below is a listing of WMI types, the Prometheus type that should be used, and any processing that needs to be done.
This applies to WMI classes inheriting Win32_PerfRawData
.
WMI type | Prometheus type | Notes |
---|---|---|
PERF_COUNTER_RAWCOUNT_HEX |
gauge |
|
PERF_COUNTER_LARGE_RAWCOUNT_HEX |
gauge |
|
PERF_COUNTER_TEXT |
?? | A string |
PERF_COUNTER_RAWCOUNT |
gauge |
|
PERF_COUNTER_LARGE_RAWCOUNT |
gauge |
|
PERF_DOUBLE_RAW |
?? | No docs |
PERF_COUNTER_DELTA |
gauge |
|
PERF_COUNTER_LARGE_DELTA |
gauge |
|
PERF_SAMPLE_COUNTER |
counter |
|
PERF_COUNTER_QUEUELEN_TYPE |
gauge |
|
PERF_COUNTER_LARGE_QUEUELEN_TYPE |
gauge |
|
PERF_COUNTER_100NS_QUEUELEN_TYPE |
gauge |
|
PERF_COUNTER_OBJ_TIME_QUEUELEN_TYPE |
gauge |
|
PERF_COUNTER_COUNTER |
counter |
|
PERF_COUNTER_BULK_COUNT |
counter |
|
PERF_RAW_FRACTION |
gauge |
Verify units. Numerator. Goes with PERF_RAW_BASE
|
PERF_COUNTER_TIMER |
counter |
PerfTime, normalise to seconds. |
PERF_PRECISION_SYSTEM_TIMER |
counter |
PerfTime, normalise to seconds. |
PERF_100NSEC_TIMER |
counter |
Normalize to seconds (value / 1e7 ) |
PERF_PRECISION_100NS_TIMER |
counter |
Normalize to seconds (value / 1e7 ) |
PERF_OBJ_TIME_TIMER |
counter |
Object-specific units |
PERF_PRECISION_OBJECT_TIMER |
counter |
Object-specific units |
PERF_SAMPLE_FRACTION |
gauge |
Verify units. Numerator. Goes with PERF_SAMPLE_BASE
|
PERF_COUNTER_TIMER_INV |
counter |
Inactive time. PerfTime, normalise to seconds |
PERF_100NSEC_TIMER_INV |
counter |
Inactive time. Normalize to seconds (value / 1e7 ) |
PERF_COUNTER_MULTI_TIMER |
Many counter
|
PerfTime, normalise to seconds |
PERF_100NSEC_MULTI_TIMER |
Many counter
|
Normalize to seconds (value / 1e7 ) |
PERF_COUNTER_MULTI_TIMER_INV |
Many counter
|
Inactive time. PerfTime, normalise to seconds |
PERF_100NSEC_MULTI_TIMER_INV |
Many counter
|
Inactive time. Normalize to seconds (value / 1e7 ) |
PERF_AVERAGE_TIMER |
summary |
Verify units. The _count is the _Base
|
PERF_ELAPSED_TIME |
gauge |
PerfTime, normalise to seconds. Convert to unixtime? |
PERF_COUNTER_NODATA |
?? | Error value? |
PERF_AVERAGE_BULK |
summary |
_sum part. Goes with PERF_AVERAGE_BASE
|
PERF_SAMPLE_BASE |
gauge |
Verify units. Denominator. Goes with PERF_SAMPLE_FRACTION
|
PERF_AVERAGE_BASE |
summary |
_count part. Goes with PERF_AVERAGE_BULK
|
PERF_RAW_BASE |
gauge |
Verify units. Denominator. Goes with PERF_RAW_FRACTION
|
PERF_PRECISION_TIMESTAMP |
counter |
PerfTime, normalise to seconds |
PERF_LARGE_RAW_FRACTION |
counter |
Verify units. Numerator. Goes with PERF_LARGE_RAW_FRACTION
|
PERF_LARGE_RAW_BASE |
counter |
Verify units. Denominator. Goes with PERF_LARGE_RAW_FRACTION
|
PERF_COUNTER_MULTI_BASE |
counter |
Seems to be a time denominator. Drop. |
PERF_COUNTER_HISTOGRAM_TYPE |
?? | No docs. |
To convert "PerfTime" units to seconds, divide by the result of QueryPerformanceFrequency()
.
This Powershell line will output available WMI classes that are of type Win32_PerfRawData
:
Get-WmiObject -query "SELECT * FROM meta_class WHERE __this ISA 'Win32_PerfRawData'" |
Select-Object -ExpandProperty Name