public class MonitorConfiguration extends Object
Modifier and Type | Field and Description |
---|---|
private long |
checkInterval
The interval in ms between consecutive checks of the monitored
nodes
|
private long |
failLimit
The number of milliseconds a node is allowed to fail before we
mark it as not working
|
private int |
failQuarantineLimit
The number of times a node is allowed to fail in one hour
before it is quarantined for an hour
|
private long |
idleLimit
The number of ms a node is allowed to stay idle before it is
pinged
|
private long |
quarantineTime
The number of ms to quarantine an unstable node
|
private long |
requestTimeout
The number of milliseconds to attempt to complete a request
before giving up
|
private int |
responseAfterFailLimit
The number of times a failed node must respond before getting
traffic again
|
Constructor and Description |
---|
MonitorConfiguration() |
Modifier and Type | Method and Description |
---|---|
long |
getCheckInterval()
Returns the interval between each ping of idle or failing nodes
Default is 1000ms
|
long |
getFailLimit()
Returns the number of milliseconds a node is allowed to fail before we
mark it as not working
|
long |
getIdleLimit()
Gets the number of ms a node (failing or working)
is allowed to stay idle before it is pinged.
|
long |
getRequestTimeout()
Returns the number of milliseconds to attempt to service a request
(at different nodes) before giving up.
|
void |
setCheckInterval(long intervalMs)
Sets the interval between each ping of idle or failing nodes
Default is 1000ms
|
void |
setFailLimit(long failLimit)
Sets the number of milliseconds a node is allowed to fail before we
mark it as not working
|
void |
setFailQuarantineLimit(int failQuarantineLimit)
The number of times a node must fail in one hour to be placed
in quarantine.
|
void |
setIdleLimit(int idleLimit)
Sets the number of ms a node (failing or working) is allowed to
stay idle before it is pinged.
|
void |
setQuarantineTime(long quarantineTime)
The number of ms an unstable node is quarantined.
|
void |
setResponseAfterFailLimit(int responseAfterFailLimit)
Sets the number of times a failed node must respond before it is put
back in service.
|
String |
toString() |
private long checkInterval
private int responseAfterFailLimit
private long idleLimit
private long requestTimeout
private long failLimit
private int failQuarantineLimit
private long quarantineTime
public void setCheckInterval(long intervalMs)
public long getCheckInterval()
public void setResponseAfterFailLimit(int responseAfterFailLimit)
public void setIdleLimit(int idleLimit)
public long getIdleLimit()
public long getRequestTimeout()
public void setFailLimit(long failLimit)
public long getFailLimit()
public void setFailQuarantineLimit(int failQuarantineLimit)
public void setQuarantineTime(long quarantineTime)
Copyright © 2017. All rights reserved.