wrench::NetworkProximityService
-
class NetworkProximityService : public wrench::Service
A network proximity service that continuously estimates inter-host latencies and can be queried for such estimates.
Public Functions
-
NetworkProximityService(const std::string &db_hostname, std::vector<std::string> hosts_in_network, const WRENCH_PROPERTY_COLLECTION_TYPE &property_list = {}, const WRENCH_MESSAGE_PAYLOAD_COLLECTION_TYPE &messagepayload_list = {})
Constructor.
- Parameters:
hostname – the name of the host on which to start the service
hosts_in_network – the hosts participating in network measurements
property_list – a property list ({} means “use all defaults”)
messagepayload_list – a message payload list ({} means “use all defaults”)
-
~NetworkProximityService() override
Destructor.
-
std::pair<std::pair<double, double>, double> getHostCoordinate(const std::string&)
Look up the current (x,y) coordinates of a given host (only for a Vivaldi network service type)
- Parameters:
requested_host – the host whose coordinates are being requested
- Returns:
A pair:
a (x,y) coordinate pair
a timestamp (the oldest timestamp of measurements used to compute the coordinate)
-
std::vector<std::string> getHostnameList()
Gets the list of hosts monitored by this service (does not involve simulated network communications with the service)
- Returns:
a list of hostnames
-
std::pair<double, double> getHostPairDistance(std::pair<std::string, std::string> hosts)
Look up a proximity value in database.
- Parameters:
hosts – the pair of hosts whose proximity is of interest
- Returns:
A pair:
The proximity value between the pair of hosts (or DBL_MAX if none)
The timestamp of the oldest measurement use to compute the proximity value (or -1.0 if none)
-
std::string getNetworkProximityServiceType()
Get the network proximity service type.
- Returns:
a string specifying the network proximity service type
Public Static Attributes
-
static constexpr double NOT_AVAILABLE = DBL_MAX
A convenient constant that is returned as a latency between two hosts when no latency estimates are available for this pair of hosts.
-
NetworkProximityService(const std::string &db_hostname, std::vector<std::string> hosts_in_network, const WRENCH_PROPERTY_COLLECTION_TYPE &property_list = {}, const WRENCH_MESSAGE_PAYLOAD_COLLECTION_TYPE &messagepayload_list = {})