WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
EnergyMeterService.h
1 
11 #ifndef WRENCH_ENERGYMETERSERVICE_H
12 #define WRENCH_ENERGYMETERSERVICE_H
13 
14 #include "wrench/services/Service.h"
15 
16 namespace wrench {
17 
18  class WMS;
19 
23  class EnergyMeterService : public Service {
24 
25  public:
26 
27  EnergyMeterService(std::string hostname, const std::vector<std::string> &hostnames, double period);
28  EnergyMeterService(std::string hostname, const std::map<std::string, double> &measurement_periods);
29 
30  /***********************/
32  /***********************/
33  void stop() override;
34  void kill();
35  /***********************/
37  /***********************/
38 
39 
40  private:
41  int main() override;
42  bool processNextMessage(double timeout);
43 
44  std::map<std::string, double> measurement_periods;
45  std::map<std::string, double> time_to_next_measurement;
46 
47  };
48 
49 };
50 
51 
52 #endif //WRENCH_ENERGYMETERSERVICE_H
wrench::EnergyMeterService::EnergyMeterService
EnergyMeterService(std::string hostname, const std::vector< std::string > &hostnames, double period)
Constructor.
Definition: EnergyMeterService.cpp:54
wrench::EnergyMeterService::kill
void kill()
Kill the energy meter (brutally terminate the daemon)
Definition: EnergyMeterService.cpp:77
wrench::EnergyMeterService::stop
void stop() override
Stop the energy meter.
Definition: EnergyMeterService.cpp:87
wrench
Definition: Action.cpp:28
wrench::S4U_Daemon::hostname
std::string hostname
The name of the host on which the daemon is running.
Definition: S4U_Daemon.h:60
wrench::Service
A service that can be added to the simulation and that can be used by a WMS when executing a workflow...
Definition: Service.h:31
wrench::EnergyMeterService
A service that measures and records energy consumption on a set of hosts at regular time intervals.
Definition: EnergyMeterService.h:23