-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support hmc client to get energy consumption from IBM System Z #1030
base: main
Are you sure you want to change the base?
Conversation
pkg/power/platform/source/hmc.go
Outdated
"k8s.io/klog/v2" | ||
|
||
"github.com/sustainable-computing-io/kepler/pkg/power/components/source" | ||
"github.com/zhmcclient/golang-zhmcclient/pkg/zhmcclient" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have any CI case for this?
pkg/power/platform/source/hmc.go
Outdated
if err != nil { | ||
klog.V(1).Infof("Error getting energy data: %v", err.Message) | ||
} | ||
klog.V(1).Infof("Get energy data successfully") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems will lead to many logs?
pkg/power/platform/source/hmc.go
Outdated
|
||
func (r *PowerHMC) GetNodeComponentsEnergy() map[int]source.NodeComponentsEnergy { | ||
pkgEnergy, _ := r.GetLiveEnergyFromLpar() | ||
pkgEnergy = pkgEnergy * 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is *3
for? can you leave a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is aimed to align with defaultSamplePeriodSec = 3
used in the kepler. Still try to finalize it and then leave explanation in the comment.
pkg/power/platform/source/hmc.go
Outdated
func (r *PowerHMC) GetPlatformEnergy() map[string]float64 { | ||
pkgEnergy, _ := r.GetLiveEnergyFromLpar() | ||
platformEnergies := make(map[string]float64) | ||
platformEnergies[hmcSensorID] = float64(pkgEnergy) * 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is lpar energy at the platform level or pkg level? if it is a platform level energy source, we can probably skip getting pkg energy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there is no pkg concept in z platform
@jiangphcn can we have a doc describe the relationship between z and x86 concept difference so we know what energy mapping to existing defined variables to give a clear picture?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Signed-off-by: Peng Hui Jiang <[email protected]>
1a534ca
to
bb49976
Compare
The purpose of this PR Support is to support external power source: HMC referred in #644.
Starting IBM Z 16, LPAR level power metrics is exposed and available. The golang zhmclient package is enhanced and open-sourced in zhmcclient/golang-zhmcclient@6bb10a7.
Current PR is using such API to provide power consumption calculation for applications running in IBM System Z.