mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-11 07:26:37 +00:00
cpu: Fetch performance counter via PDH.dll via feature toggle. (off by default) (#1627)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||
@@ -26,3 +27,11 @@ func ExpandEnabledCollectors(enabled string) []string {
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
func PDHEnabled() bool {
|
||||
if v, ok := os.LookupEnv("WINDOWS_EXPORTER_PERF_COUNTERS_ENGINE"); ok && v == "pdh" {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user