public class ServerHealthManager extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CACHE_TIME_MS |
Constructor and Description |
---|
ServerHealthManager(String serverPoolName,
com.google.common.collect.ImmutableList<URI> servers,
int errorCheckTimeRangeMillis,
float maxErrorPercentage,
int latencyCheckTimeRangeMillis,
int maxAcceptableLatencyMillis,
int minSamplesToReportError,
BuckEventBus eventBus,
Clock clock) |
Modifier and Type | Method and Description |
---|---|
URI |
getBestServer() |
void |
reportException(URI server,
IOException exp) |
void |
reportPingLatency(URI server,
long latencyMillis) |
void |
reportRequestError(URI server) |
void |
reportRequestSuccess(URI server) |
String |
toString() |
public static final int CACHE_TIME_MS
public ServerHealthManager(String serverPoolName, com.google.common.collect.ImmutableList<URI> servers, int errorCheckTimeRangeMillis, float maxErrorPercentage, int latencyCheckTimeRangeMillis, int maxAcceptableLatencyMillis, int minSamplesToReportError, BuckEventBus eventBus, Clock clock)
public void reportPingLatency(URI server, long latencyMillis)
public void reportRequestError(URI server)
public void reportException(URI server, IOException exp)
public void reportRequestSuccess(URI server)
public URI getBestServer() throws NoHealthyServersException
NoHealthyServersException