Skip to content

Commit

Permalink
print container features
Browse files Browse the repository at this point in the history
Signed-off-by: Sunyanan Choochotkaew <[email protected]>
  • Loading branch information
sunya-ch committed Oct 10, 2023
1 parent a967d9d commit fc286dc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/bpfassets/attacher/libbpf_attacher.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ func attachLibbpfModule() (*bpf.Module, error) {

// if any counter is not enabled, we need disable HardwareCountersEnabled
HardwareCountersEnabled = false
klog.Info("set HardwareCountersEnabled=false")
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions pkg/collector/metric_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/sustainable-computing-io/kepler/pkg/bpfassets/attacher"
"github.com/sustainable-computing-io/kepler/pkg/cgroup"
"github.com/sustainable-computing-io/kepler/pkg/config"
"github.com/sustainable-computing-io/kepler/pkg/model"
"github.com/sustainable-computing-io/kepler/pkg/power/accelerator/gpu"
"github.com/sustainable-computing-io/kepler/pkg/power/accelerator/qat"
"github.com/sustainable-computing-io/kepler/pkg/utils"
Expand Down Expand Up @@ -81,6 +82,14 @@ func (c *Collector) Initialize() error {
return err
}

// For local estimator, there is endpoint provided, thus we should let
// model component decide whether/how to init
model.CreatePowerEstimatorModels(
collector_metric.ContainerFeaturesNames,
collector_metric.NodeMetadataFeatureNames,
collector_metric.NodeMetadataFeatureValues,
)

c.prePopulateContainerMetrics(pods)
c.updateNodeEnergyMetrics()

Expand Down
2 changes: 2 additions & 0 deletions pkg/model/container_energy.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ func CreateContainerPowerEstimatorModel(containerFeatureNames, systemMetaDataFea
ContainerPlatformPowerModel, err = createPowerModelEstimator(modelConfig)
if err == nil {
klog.Infof("Using the %s Power Model to estimate Container Platform Power", modelConfig.ModelType.String()+"/"+modelConfig.ModelOutputType.String())
klog.Infof("container feature names: %v", modelConfig.ContainerFeatureNames)
} else {
klog.Infof("Failed to create %s Power Model to estimate Container Platform Power: %v\n", modelConfig.ModelType.String()+"/"+modelConfig.ModelOutputType.String(), err)
}
Expand All @@ -116,6 +117,7 @@ func CreateContainerPowerEstimatorModel(containerFeatureNames, systemMetaDataFea
ContainerComponentPowerModel, err = createPowerModelEstimator(modelConfig)
if err == nil {
klog.Infof("Using the %s Power Model to estimate Container Component Power", modelConfig.ModelType.String()+"/"+modelConfig.ModelOutputType.String())
klog.Infof("container feature names: %v", modelConfig.ContainerFeatureNames)
} else {
klog.Infof("Failed to create %s Power Model to estimate Container Component Power: %v\n", modelConfig.ModelType.String()+"/"+modelConfig.ModelOutputType.String(), err)
}
Expand Down

0 comments on commit fc286dc

Please sign in to comment.