Skip to content

Commit

Permalink
feat: add --disable-power-meter option
Browse files Browse the repository at this point in the history
Signed-off-by: Sunyanan Choochotkaew <[email protected]>
  • Loading branch information
sunya-ch committed Aug 21, 2024
1 parent 821afc5 commit 11ff51d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type AppConfig struct {
ApiserverEnabled bool
RedfishCredFilePath string
ExposeEstimatedIdlePower bool
DisablePowerMeter bool
}

func newAppConfig() *AppConfig {
Expand All @@ -79,6 +80,7 @@ func newAppConfig() *AppConfig {
flag.BoolVar(&_config.ApiserverEnabled, "apiserver", true, "if apiserver is disabled, we collect pod information from kubelet")
flag.StringVar(&_config.RedfishCredFilePath, "redfish-cred-file-path", "", "path to the redfish credential file")
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")
flag.BoolVar(&_config.DisablePowerMeter, "disable-power-meter", false, "whether manually disable power meter read and forcefully apply the estimator for node powers")

return _config
}
Expand Down Expand Up @@ -115,6 +117,9 @@ func main() {
func() float64 { return 1 },
))

platform.SetIsSystemCollectionSupported(!appConfig.DisablePowerMeter)
components.SetIsSystemCollectionSupported(!appConfig.DisablePowerMeter)

config.SetEnabledEBPFCgroupID(appConfig.EnableEBPFCgroupID)
config.SetEnabledHardwareCounterMetrics(appConfig.ExposeHardwareCounterMetrics)
config.SetEnabledGPU(appConfig.EnableGPU)
Expand Down

0 comments on commit 11ff51d

Please sign in to comment.