Skip to content

Commit 9fc7c7c

Browse files
authored
Merge pull request #1717 from sunya-ch/model-server-patch-1
feat: add --disable-power-meter option
2 parents 821afc5 + 11ff51d commit 9fc7c7c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/exporter/exporter.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ type AppConfig struct {
6464
ApiserverEnabled bool
6565
RedfishCredFilePath string
6666
ExposeEstimatedIdlePower bool
67+
DisablePowerMeter bool
6768
}
6869

6970
func newAppConfig() *AppConfig {
@@ -79,6 +80,7 @@ func newAppConfig() *AppConfig {
7980
flag.BoolVar(&_config.ApiserverEnabled, "apiserver", true, "if apiserver is disabled, we collect pod information from kubelet")
8081
flag.StringVar(&_config.RedfishCredFilePath, "redfish-cred-file-path", "", "path to the redfish credential file")
8182
flag.BoolVar(&_config.ExposeEstimatedIdlePower, "expose-estimated-idle-power", false, "estimated idle power is meaningful only if Kepler is running on bare-metal or when there is only one virtual machine on the node")
83+
flag.BoolVar(&_config.DisablePowerMeter, "disable-power-meter", false, "whether manually disable power meter read and forcefully apply the estimator for node powers")
8284

8385
return _config
8486
}
@@ -115,6 +117,9 @@ func main() {
115117
func() float64 { return 1 },
116118
))
117119

120+
platform.SetIsSystemCollectionSupported(!appConfig.DisablePowerMeter)
121+
components.SetIsSystemCollectionSupported(!appConfig.DisablePowerMeter)
122+
118123
config.SetEnabledEBPFCgroupID(appConfig.EnableEBPFCgroupID)
119124
config.SetEnabledHardwareCounterMetrics(appConfig.ExposeHardwareCounterMetrics)
120125
config.SetEnabledGPU(appConfig.EnableGPU)

0 commit comments

Comments
 (0)