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

REST reporter

Loïc Huertas edited this page Nov 4, 2015 · 4 revisions

Details

You can use this reporter by using the given actor: RestReporter .

val cpu_simple = new PowerMeter(actorRefFactory, Seq(ProcFSCpuSimpleModule())) // module creation
val restReporter = actorRefFactory.actorOf(Props(classOf[RestReporter], cpu_simple, actorRefFactory)) // actor creation

Configuration

hostAddress

  • Host IP address used for HTTP server and for identifying a PowerAPI instance on distributed context.
  • Default value : localhost

Example

powerapi.rest.host-address = "192.168.1.25"

dbAddress

  • Database IP address.
  • Default value : localhost

Example

powerapi.rest.database-address = "192.168.1.40"

Execution

In these exemples, the host and database address is 127.0.0.1

To see all monitored processes :

curl http://127.0.0.1/energy

To start monitoring of the 123 process:

curl -X POST http://127.0.0.1/energy/123/start

To stop monitoring of the 123 process:

curl -X POST http://127.0.0.1/energy/123/stop