Skip to content
This repository was archived by the owner on Mar 11, 2019. It is now read-only.

Commit 4a4a106

Browse files
authored
Merge pull request #83 from Spirals-Team/develop
Disk module, minor bug fixes & library update
2 parents 4995b7d + d0c4439 commit 4a4a106

File tree

297 files changed

+3872
-2194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+3872
-2194
lines changed

.travis.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
env:
77
global:
88
- secure: "BfP5e/OPM62e3ktm4RD2nuBJls2u8zdXg/YjNyght5dpD2vCjL6ZHWhgDM2mNFpzgYPiE3DPsSE7g2ZlsBUJCuK8a7lB5r+OiWFcWkilC1E9QX6OMcDTpEKb5A9InFGcpt0xbjY5+8qaIbaN8TJcdxaxeit0TZEvxeirQa5OOEY=" # COVERALLS_REPO_TOKEN
9-
- secure: "ldIw526YR2Fe6FlfIPlbbOojEeg7etbO4dqiL4TLm00SBhVkKG+DuckhFixVAvAJx1Q1LuVyUPsXaR77OjqiTxSkaH+GbsmR5VIM4qA/kBheD4IiV4wTamg679d+AldRNWcGtLpefgwqlCJ53FcMzUT9TH/MJcbEaOJ5GKW9v+s=" # CODACY_PROJECT_TOKEN
9+
# - secure: "ldIw526YR2Fe6FlfIPlbbOojEeg7etbO4dqiL4TLm00SBhVkKG+DuckhFixVAvAJx1Q1LuVyUPsXaR77OjqiTxSkaH+GbsmR5VIM4qA/kBheD4IiV4wTamg679d+AldRNWcGtLpefgwqlCJ53FcMzUT9TH/MJcbEaOJ5GKW9v+s=" # CODACY_PROJECT_TOKEN
1010
- secure: "MLFJWju96LymkPNIsUeJelNN5J3BK55OV/RXVMONC5kDr4N7T4JyhT6KUa4k+FSJ0S1GTPQMWQQEkWDF1MlZXv5yGwW4h5rN3tt//vqyHk968SyqlhTdygqzx6tO6t3OsfQ2F1AqVWAWsHQckL+VmhEo53VqVXpsqLy9DyLYGjs=" # DOCKER_EMAIL
1111
- secure: "FbLHLKNAtpj7ZVgSobOPgAgdLK3/P4sR6RcaOmpVRsgaqodTPx7VkzGpkf4rOqPwxKU3+96vr0TlIdPRYWAE39Y3gMb1dyZ34+CxsrJ3avJYc2+9NT3kmAuU33Iy1DCo3IEnR7pWVVEyR80ob0c1ASfPAW1JN8DhBRRERpkMyn4=" # DOCKER_USER
1212
- secure: "VLK9NI4yE+hLV8rgjiB0hOfQn1uFO7cEHHL4sEDZKNu1TgvwfTrEWEzMMLvG8pwK/7eG78xfNB489m/Imj7Y52xK6sZuY7Y78Y06mkepZS8PisAJiW59kHWH1Ci84DYHZ0y07NAgvCOSLS9l0ncgLdlGvRboR9KBYDMEWycwEn8=" # DOCKER_PWD
@@ -24,33 +24,35 @@ cache:
2424
language: scala
2525

2626
scala:
27-
- 2.11.7
27+
- 2.12.1
2828

2929
jdk:
30-
- openjdk7
30+
- oraclejdk8
3131

3232
# workaround for openjdk buffer overflow
3333
addons:
3434
hostname: localhost
3535

3636
script:
3737
- sbt compile test:compile
38-
- sbt 'set concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)' "project powerapi-core" coverage test
38+
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then sbt "set concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)" "project powerapi-core" test; else sbt "set concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)" "project powerapi-core" coverage test ; fi'
3939
- find $HOME/.sbt -name "*.lock" | xargs rm
4040

4141
before_install:
42-
- openssl aes-256-cbc -K $encrypted_48ebb0d1c0b9_key -iv $encrypted_48ebb0d1c0b9_iv -in secrets.tar.enc -out secrets.tar -d
43-
- tar xvf secrets.tar
42+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then openssl aes-256-cbc -K $encrypted_48ebb0d1c0b9_key -iv $encrypted_48ebb0d1c0b9_iv -in secrets.tar.enc -out secrets.tar -d; fi'
43+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then tar xvf secrets.tar; fi'
4444
- wget -O influxdb.deb https://s3.amazonaws.com/influxdb/influxdb_0.10.2-1_amd64.deb
4545
- sudo dpkg -i influxdb.deb
4646
- sudo service influxdb start
4747
- sleep 5; /usr/bin/influx --execute "CREATE USER powerapi WITH PASSWORD 'powerapi' WITH ALL PRIVILEGES"
48-
- sudo bash -c "source /usr/local/rvm/scripts/rvm; rvm use 2.2.3; gem install github_changelog_generator"
48+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3; fi'
49+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then curl -sSL https://get.rvm.io | bash; fi'
50+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sudo bash -c "source /home/travis/.rvm/scripts/rvm; rvm use 2.2.3; gem install github_changelog_generator"; fi'
4951

5052
after_success:
51-
- sbt "project powerapi-core" coverageReport
52-
- sbt "project powerapi-core" codacyCoverage
53-
- sbt "project powerapi-core" coveralls
53+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sbt "project powerapi-core" coverageReport; fi'
54+
# - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sbt "project powerapi-core" codacyCoverage; fi'
55+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sbt "project powerapi-core" coveralls; fi'
5456

5557
before_deploy:
5658
- sbt "project powerapi-sampling" universal:packageZipTarball

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](http://www.gnu.org/licenses/agpl-3.0)
66
[![Build Status](https://travis-ci.org/Spirals-Team/powerapi.svg)](https://travis-ci.org/Spirals-Team/powerapi)
77
[![Coverage Status](https://coveralls.io/repos/Spirals-Team/powerapi/badge.svg)](https://coveralls.io/r/Spirals-Team/powerapi)
8-
[![Codacy Badge](https://www.codacy.com/project/badge/31f7762213c340fbb5fe1463a5b871d4)](https://www.codacy.com/app/mcolmant/powerapi)
98

109
PowerAPI is a middleware toolkit for building software-defined power meters.
1110
Software-defined power meters are configurable software libraries that can estimate the power consumption of software in real-time.
@@ -46,26 +45,25 @@ PowerAPI is used in a variety of projects to address key challenges of GreenIT:
4645
* [Greenspector](http://greenspector.com) optimises the power consumption of software by identifying potential energy leaks in the source code.
4746

4847
## Acknowledgments
49-
We all stand on the shoulders of giants and get by with a little help from our friends. PowerAPI is written in [Scala](http://www.scala-lang.org) (version 2.11.7 under [3-clause BSD license](http://www.scala-lang.org/license.html)) and built on top of:
50-
* [Akka](http://akka.io) (version 2.3.14 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for asynchronous processing
51-
* [Typesafe Config](https://github.com/typesafehub/config) (version 1.2.1 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for reading configuration files.
52-
* [Apache log4j2](http://logging.apache.org/log4j/2.x) (version 2.5 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for logging outside actors.
53-
* [powerspy.scala](https://github.com/Spirals-Team/powerspy.scala) (version 1.2 under [AGPL license](http://www.gnu.org/licenses/agpl-3.0.html)), for using the [PowerSpy powermeter](http://www.alciom.com/en/products/powerspy2-en-gb-2.html).
48+
We all stand on the shoulders of giants and get by with a little help from our friends. PowerAPI is written in [Scala](http://www.scala-lang.org) (version 2.12.1 under [3-clause BSD license](http://www.scala-lang.org/license.html)) and built on top of:
49+
* [Akka](http://akka.io) (version 2.4.14 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for asynchronous processing.
50+
* [Typesafe Config](https://github.com/typesafehub/config) (version 1.3.1 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for reading configuration files.
51+
* [scala-logging](https://github.com/typesafehub/scala-logging) (version 3.5.0 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for Scala wrapping SL4J.
52+
* [logback](https://github.com/qos-ch/logback) (version 1.1.7 under [LGPL 2.1 license](https://github.com/qos-ch/logback/blob/master/LICENSE.txt)), for logging purpose.
53+
* [powerspy.scala](https://github.com/Spirals-Team/powerspy.scala) (version 1.2 under [AGPL license](http://www.gnu.org/licenses/agpl-3.0.html)), for using the [PowerSpy](http://www.alciom.com/en/products/powerspy2-en-gb-2.html) power meter.
5454
* [BridJ](https://code.google.com/p/bridj/) (version 0.7.0 under [3-clause BSD license](https://github.com/ochafik/nativelibs4java/blob/master/libraries/BridJ/LICENSE)), for system or C calls.
55-
* [JNA](https://github.com/twall/jna) (version 4.2.1 under [LGPL 2.1 license](https://github.com/twall/jna/blob/master/LGPL2.1)), for system or C calls.
56-
* [perfmon2](http://sourceforge.net/p/perfmon2/libpfm4/ci/master/tree) (version 4.6.0 under [MIT license](http://sourceforge.net/p/perfmon2/libpfm4/ci/master/tree/COPYING)), for accessing hardware performance counters.
55+
* [JNA](https://github.com/twall/jna) (version 4.2.2 under [LGPL 2.1 license](https://github.com/twall/jna/blob/master/LGPL2.1)), for system or C calls.
56+
* [perfmon2](http://sourceforge.net/p/perfmon2/libpfm4/ci/master/tree) (version 4.7.0 under [MIT license](http://sourceforge.net/p/perfmon2/libpfm4/ci/master/tree/COPYING)), for accessing hardware performance counters.
5757
* [JFreeChart](http://www.jfree.org/jfreechart/) (version 1.0.19 under [LGPL license](https://www.gnu.org/licenses/lgpl.html)), for creation of interactive and animated charts.
58-
* [Scala IO](http://jesseeichar.github.io/scala-io-doc/0.4.3/index.html#!/overview) (version 0.4.3 under [3-clause BSD license](http://www.scala-lang.org/license.html)), for an extensions of IO.
59-
* [Saddle](http://saddle.github.io/) (version 1.3.4 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for data manipulation.
58+
* [grizzled-scala](http://software.clapper.org/grizzled-scala/) (version 4.0.0 under [3-clause BSD license](https://github.com/bmc/grizzled-scala/blob/master/LICENSE.md)), for new utility classes and objects.
6059
* [Sigar](https://support.hyperic.com/display/SIGAR/Home) (version 1.6.5 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for providing a portable interface for gathering system information.
6160
* [spray-json](http://spray.io/) (version 1.3.2 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for (de)serializing JSON.
62-
* [docker-java](https://github.com/docker-java/docker-java) (version 2.1.4 under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0)), for using the JAVA Docker API.
63-
* [influxdb-java](https://github.com/influxdata/influxdb-java) (version 2.1 under [MIT license](https://github.com/influxdata/influxdb-java/blob/master/LICENSE)), for using the JAVA InfluxDB API.
61+
* [scala-influxdb-client](https://github.com/paulgoldbaum/scala-influxdb-client) (version 0.5.2 under [MIT license](https://github.com/paulgoldbaum/scala-influxdb-client/blob/master/LICENSE)), for using an asynchronous scala API for InfluxDB.
6462

6563
# License
6664
This software is licensed under the *GNU Affero General Public License*, quoted below.
6765

68-
Copyright (C) 2011-2016 Inria, University of Lille 1.
66+
Copyright (C) 2011-2017 Inria, University of Lille 1.
6967

7068
PowerAPI is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
7169

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ name := "powerapi"
22

33
// Logging
44
libraryDependencies in ThisBuild ++= Seq(
5-
"org.apache.logging.log4j" % "log4j-api" % "2.5",
6-
"org.apache.logging.log4j" % "log4j-core" % "2.5"
5+
"com.typesafe.scala-logging" %% "scala-logging" % "3.5.0",
6+
"ch.qos.logback" % "logback-classic" % "1.1.7"
77
)

docker/sampling/Dockerfile-sampling

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM alpine:latest
22

3-
ENV POWERAPI_PACKAGE powerapi-sampling
3+
ENV POWERAPI_PACKAGE powerapi-sampling-cpu
44
ENV LIBPFM_PACKAGE libpfm-4.6.0
55

66
ENV INSTALL_PACKAGES ca-certificates linux-headers libc-dev make gcc patch

powerapi-cli/src/main/scala/org/powerapi/app/PowerAPI.scala

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ package org.powerapi.app
2424

2525
import java.lang.management.ManagementFactory
2626

27+
import scala.concurrent.Await
2728
import scala.concurrent.duration.DurationInt
2829
import scala.sys
2930
import scala.sys.process.stringSeqToProcess
@@ -33,6 +34,7 @@ import org.powerapi.core.power._
3334
import org.powerapi.core.target._
3435
import org.powerapi.module.cpu.dvfs.CpuDvfsModule
3536
import org.powerapi.module.cpu.simple.{ProcFSCpuSimpleModule, SigarCpuSimpleModule}
37+
import org.powerapi.module.disk.simple.DiskSimpleModule
3638
import org.powerapi.module.extpowermeter.g5komegawatt.G5kOmegaWattModule
3739
import org.powerapi.module.extpowermeter.powerspy.PowerSpyModule
3840
import org.powerapi.module.extpowermeter.rapl.RAPLModule
@@ -47,8 +49,8 @@ import org.powerapi.{PowerDisplay, PowerMeter, PowerMonitoring}
4749
* @author <a href="mailto:l.huertas.pro@gmail.com">Loïc Huertas</a>
4850
*/
4951
object PowerAPI extends App {
50-
val modulesR = """(procfs-cpu-simple|sigar-cpu-simple|cpu-dvfs|libpfm|libpfm-process|libpfm-core|libpfm-core-process|powerspy|g5k-omegawatt|rapl)(,(procfs-cpu-simple|sigar-cpu-simple|cpu-dvfs|libpfm|libpfm-process|libpfm-core|libpfm-core-process|powerspy|g5k-omegawatt|rapl))*""".r
51-
val aggR = """max|min|geomean|logsum|mean|median|stdev|sum|variance""".r
52+
val modulesR = """(procfs-cpu-simple|sigar-cpu-simple|cpu-dvfs|libpfm|libpfm-process|libpfm-core|libpfm-core-process|powerspy|g5k-omegawatt|rapl|disk-simple)(,(procfs-cpu-simple|sigar-cpu-simple|cpu-dvfs|libpfm|libpfm-process|libpfm-core|libpfm-core-process|powerspy|g5k-omegawatt|rapl|disk-simple))*""".r
53+
val aggR = """max|min|mean|median|sum""".r
5254
val durationR = """\d+""".r
5355
val pidsR = """(\d+)(,(\d+))*""".r
5456
val appsR = """([^,]+)(,([^,]+))*""".r
@@ -74,13 +76,9 @@ object PowerAPI extends App {
7476
str match {
7577
case "max" => MAX
7678
case "min" => MIN
77-
case "geomean" => GEOMEAN
78-
case "logsum" => LOGSUM
7979
case "mean" => MEAN
8080
case "median" => MEDIAN
81-
case "stdev" => STDEV
8281
case "sum" => SUM
83-
case "variance" => VARIANCE
8482
}
8583
}
8684

@@ -93,12 +91,12 @@ object PowerAPI extends App {
9391
|Different settings can be used per software-defined power meter by using the prefix option.
9492
|Please, refer to the documentation inside the GitHub wiki for further details.
9593
|
96-
|usage: ./powerapi modules procfs-cpu-simple|sigar-cpu-simple|cpu-dvfs|libpfm|libpfm-process|libpfm-core|libpfm-core-process|powerspy|g5k-omegawatt|rapl (1, *) *--prefix [name]*
94+
|usage: ./powerapi modules procfs-cpu-simple|sigar-cpu-simple|cpu-dvfs|libpfm|libpfm-process|libpfm-core|libpfm-core-process|powerspy|g5k-omegawatt|rapl|disk-simple (1, *) *--prefix [name]*
9795
| monitor (1, *)
9896
| --frequency $MILLISECONDS
9997
| --self (0, 1) --pids [pid, ...] (0, *) --apps [app, ...] (0, *) --containers [id, ...] (0, *) | all (0, 1)
10098
| --agg max|min|geomean|logsum|mean|median|stdev|sum|variance
101-
| --console (0, 1) --file $FILEPATH (0, *) --chart (0, 1) --influx $HOST $USER $PWD $DB $MEASUREMENT (0, *)
99+
| --console (0, 1) --file $FILEPATH (0, *) --chart (0, 1) --influx $HOST $PORT $USER $PWD $DB $MEASUREMENT (0, *)
102100
| duration [s]
103101
|
104102
|example: ./powerapi modules procfs-cpu-simple monitor --frequency 1000 --apps firefox,chrome --agg max --console \
@@ -175,10 +173,12 @@ object PowerAPI extends App {
175173
cliMonitorsSubcommand(options, currentMonitor + ('displays ->
176174
(currentMonitor.getOrElse('displays, Set[Any]()).asInstanceOf[Set[Any]] + new JFreeChartDisplay)
177175
), tail)
178-
case "--influx" :: host :: user :: pwd :: db :: measurement :: tail =>
179-
cliMonitorsSubcommand(options, currentMonitor + ('displays ->
180-
(currentMonitor.getOrElse('displays, Set[Any]()).asInstanceOf[Set[Any]] + new InfluxDisplay(host, user, pwd, db, measurement))
181-
), tail)
176+
case "--influx" :: host :: port :: user :: pwd :: db :: measurement :: tail =>
177+
cliMonitorsSubcommand(options, currentMonitor + ('displays -> {
178+
val influxDisplay = new InfluxDisplay(host, port.toInt, user, pwd, db, measurement)
179+
Await.result(influxDisplay.database.create(), 30.seconds)
180+
currentMonitor.getOrElse('displays, Set[Any]()).asInstanceOf[Set[Any]] + influxDisplay
181+
}), tail)
182182
case option :: tail =>
183183
println(s"unknown monitor option $option")
184184
sys.exit(1)
@@ -225,6 +225,8 @@ object PowerAPI extends App {
225225
G5kOmegaWattModule(powerMeterConf('prefix).asInstanceOf[Option[String]])
226226
case "rapl" =>
227227
RAPLModule()
228+
case "disk-simple" =>
229+
DiskSimpleModule(powerMeterConf('prefix).asInstanceOf[Option[String]])
228230
}
229231
}).toSeq
230232

powerapi-core/build.sbt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,24 @@ resolvers ++= Seq(
1212

1313
// App
1414
libraryDependencies ++= Seq(
15-
"com.typesafe.akka" %% "akka-actor" % "2.3.14",
16-
"com.typesafe" % "config" % "1.2.1",
15+
"com.typesafe.akka" %% "akka-actor" % "2.4.14",
16+
"com.typesafe" % "config" % "1.3.1",
1717
"fr.inria.powerspy" % "powerspy-core_2.11" % "1.2",
1818
"com.nativelibs4java" % "bridj" % "0.7.0",
19-
"com.github.scala-incubator.io" %% "scala-io-core" % "0.4.3",
20-
"com.github.scala-incubator.io" %% "scala-io-file" % "0.4.3",
2119
"org.jfree" % "jfreechart" % "1.0.19",
22-
"org.scala-saddle" %% "saddle-core" % "1.3.4",
20+
"org.clapper" %% "grizzled-scala" % "4.0.0",
2321
"org.hyperic" % "sigar" % "1.6.5.132",
24-
"net.java.dev.jna" % "jna" % "4.2.1",
22+
"net.java.dev.jna" % "jna" % "4.2.2",
2523
"io.spray" %% "spray-json" % "1.3.2",
26-
"com.github.docker-java" % "docker-java" % "2.1.4",
27-
"org.influxdb" % "influxdb-java" % "2.1"
24+
"com.paulgoldbaum" %% "scala-influxdb-client" % "0.5.2",
25+
"joda-time" % "joda-time" % "2.9.6"
2826
)
2927

3028
// Tests
3129
libraryDependencies ++= Seq(
32-
"com.typesafe.akka" %% "akka-testkit" % "2.3.14" % "test",
33-
"org.scalatest" %% "scalatest" % "2.2.5" % "test",
34-
"org.scalamock" %% "scalamock-scalatest-support" % "3.2.2" % "test"
30+
"com.typesafe.akka" %% "akka-testkit" % "2.4.14" % "test",
31+
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
32+
"org.scalamock" %% "scalamock-scalatest-support" % "3.4.2" % "test"
3533
)
3634

3735
startYear := Some(2014)

powerapi-core/src/main/scala/org/powerapi/PowerMeter.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,15 @@ import java.util.concurrent.TimeUnit
2828
import scala.concurrent.ExecutionContext.Implicits._
2929
import scala.concurrent.duration.{DurationLong, FiniteDuration}
3030
import scala.concurrent.{Await, Future}
31-
3231
import akka.actor._
3332
import akka.pattern.{after, ask, gracefulStop, pipe}
3433
import akka.util.Timeout
35-
3634
import org.powerapi.core.MonitorChannel.{startMonitor, stopAllMonitor}
3735
import org.powerapi.core.power._
3836
import org.powerapi.core.target.Target
3937
import org.powerapi.core.{ActorComponent, Clocks, ConfigValue, Configuration, MessageBus, Monitor, Monitors}
4038
import org.powerapi.module.FormulaChannel.{startFormula, stopAllFormula}
39+
import org.powerapi.module.PowerChannel.AggregatePowerReport
4140
import org.powerapi.module.SensorChannel.{startSensor, stopAllSensor}
4241
import org.powerapi.module.{Formula, Formulas, Sensor, Sensors}
4342
import org.powerapi.reporter.ReporterChannel.stopAllReporter
@@ -245,5 +244,5 @@ trait PowerMonitoring {
245244
*/
246245
trait PowerDisplay {
247246

248-
def display(muid: UUID, timestamp: Long, targets: Set[Target], devices: Set[String], power: Power)
247+
def display(aggregatePowerReport: AggregatePowerReport)
249248
}

powerapi-core/src/main/scala/org/powerapi/core/MonitorActors.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class MonitorChild(eventBus: MessageBus, muid: UUID, targets: Set[Target]) exten
151151
* Aggregate all RawPowerReport for the current monitoring.
152152
*/
153153
def aggregate(aggR: AggregatePowerReport, powerReport: RawPowerReport, aggregator: Option[Seq[Power] => Power]): Unit = {
154-
if (aggR.size == 0 || aggR.tick == powerReport.tick) {
154+
if (aggR.size == 0 || aggR.ticks.map(_.timestamp).contains(powerReport.tick.timestamp)) {
155155
aggR += powerReport
156156
}
157157
else {

0 commit comments

Comments
 (0)