Initializes a Mantle instance
- Parameters
-
| s | name of current server (the one running Mantle) |
Configure load balancing policies
- Parameters
-
| when | callback that decides when to move load |
| where | callback that decides which servers to send load to |
| howmuch | callback that decides what fraction of load to shed |
- Returns
- 0 on success, < 0 otherwise
| int Mantle::howmuch |
( |
Load & |
decision | ) |
|
Executes the howmuch callback, which decides how much load the service should move
- Parameters
-
| decision | amount of load the service should move |
- Returns
- 0 on success, < 0 otherwise
Update the metrics maintained by Mantle (should be done every polling interval)
- Parameters
-
| metrics | values to update metrics data structure with |
- Returns
- 0 on success, < 0 otherwise
| int Mantle::when |
( |
bool & |
decision | ) |
|
Executes the when callback, which decides whether the service should move load or not
- Parameters
-
| decision | true if the policy wants the service to migrate load, false otherwise |
- Returns
- 0 on success, < 0 otherwise
| int Mantle::where |
( |
Targets & |
decision | ) |
|
Executes the where callback, which decides where the service should move load (which servers)
- Parameters
-
| decision | dictionary (rank -> load) that describes which rank to send load to |
- Returns
- 0 on success, < 0 otherwise
The documentation for this class was generated from the following file: