use linux perf tool for amd power usage,
add support for intel DC ssds
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const milliJoulePerJoule = float64(1000000)
|
||||
const microJoulePerJoule = float64(1000000)
|
||||
|
||||
type EnergyState struct {
|
||||
lastEnergy uint64
|
||||
@@ -36,7 +36,7 @@ func (r *RaplDriver) Render(term common.Terminal) error {
|
||||
}
|
||||
|
||||
power := p.([]PowerSensor)
|
||||
term.Subheader("Power /sys/class/powercap/intel-rapl")
|
||||
term.Subheader("Power (rapl)")
|
||||
|
||||
for _, sensor := range power {
|
||||
// \033[K clears from cursor to end of line (prevents lingering chars)
|
||||
@@ -127,7 +127,7 @@ func (r *RaplDriver) calculateEnergyDelta(inputs []string, out *[]PowerSensor) {
|
||||
// the value will be off for that one measurement, then become correct again
|
||||
energyDiff := float64(microJoules - prevState.lastEnergy)
|
||||
|
||||
watts := (energyDiff / milliJoulePerJoule) / timeDiff
|
||||
watts := (energyDiff / microJoulePerJoule) / timeDiff
|
||||
|
||||
r.energyState[path] = EnergyState{
|
||||
lastEnergy: microJoules,
|
||||
|
||||
Reference in New Issue
Block a user