Skip to content

Commit

Permalink
Fix version setting and Watts calculation (#12)
Browse files Browse the repository at this point in the history
* Remove explicit version

Explicit version was breaking git version inference

* Calculate watts denominator correctly

getSeconds returned the seconds part of the duration

but we actually want the total duration _expressed as seconds_
  • Loading branch information
jisantuc authored Mar 3, 2022
1 parent c22e6ab commit d74c054
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name := """sbt-energymonitor"""
version := "0.1-SNAPSHOT"
organization := "com.47deg"

ThisBuild / githubOrganization := "47degrees"
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/energymonitor/EnergyMonitorPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ object EnergyMonitorPlugin extends AutoPlugin {
val samples = diff.getPrimitiveSample()
val duration = diff.getTimeElapsed()
val totalJoules = samples.sum
val watts = totalJoules / duration.getSeconds().toDouble
val watts = totalJoules / (duration.toMillis().toDouble / 1000)
f"""
| During CI attempt ${attemptNumber}%d, this run consumed power from ${samples.size}%d CPU cores.
|
Expand Down

0 comments on commit d74c054

Please sign in to comment.