10 #ifndef WRENCH_HOSTSTATECHANGEDETECTOR_H 11 #define WRENCH_HOSTSTATECHANGEDETECTOR_H 13 #include <wrench/services/Service.h> 14 #include "wrench/simgrid_S4U_util/S4U_Daemon.h" 15 #include "HostStateChangeDetectorProperty.h" 29 std::map<std::string, std::string> default_property_values = {
36 std::vector<std::string> hosts_to_monitor,
37 bool notify_when_turned_on,
38 bool notify_when_turned_off,
39 bool notify_when_speed_change,
40 std::shared_ptr<S4U_Daemon> creator,
41 std::string mailbox_to_notify,
50 void cleanup(
bool has_terminated_cleanly,
int return_value)
override;
51 void hostStateChangeCallback(std::string
const &
hostname);
52 void hostSpeedChangeCallback(std::string
const &hostname);
54 std::vector<std::string> hosts_to_monitor;
55 bool notify_when_turned_on;
56 bool notify_when_turned_off;
57 bool notify_when_speed_change;
58 std::string mailbox_to_notify;
61 std::vector<std::pair<std::string, bool>> hosts_that_have_recently_changed_state;
62 std::vector<std::pair<std::string, double>> hosts_that_have_recently_changed_speed;
64 std::shared_ptr<S4U_Daemon> creator;
66 std::vector<std::string> hosts_that_have_recently_turned_on;
67 std::vector<std::string> hosts_that_have_recently_turned_off;
69 unsigned int on_state_change_call_back_id;
70 unsigned int on_speed_change_call_back_id;
82 #endif //WRENCH_HOSTSTATECHANGEDETECTOR_H std::map< std::string, std::string > property_list
The service's property list.
Definition: Service.h:110
A service that can be added to the simulation and that can be used by a WMS when executing a workflow...
Definition: Service.h:26
static const std::string MONITORING_PERIOD
The monitoring period in seconds (default: 1.0)
Definition: HostStateChangeDetectorProperty.h:25
void kill()
Kill the service.
Definition: HostStateChangeDetector.cpp:169
std::string hostname
The name of the host on which the daemon is running.
Definition: S4U_Daemon.h:51
HostStateChangeDetector(std::string host_on_which_to_run, std::vector< std::string > hosts_to_monitor, bool notify_when_turned_on, bool notify_when_turned_off, bool notify_when_speed_change, std::shared_ptr< S4U_Daemon > creator, std::string mailbox_to_notify, std::map< std::string, std::string > property_list={})
Constructor.
Definition: HostStateChangeDetector.cpp:48
A service that detects and reports on host state changes (turned on, turned off)
Definition: HostStateChangeDetector.h:26