public class CircuitBreakerService extends AbstractService implements HarvestListener, AgentConfigListener
CircuitBreakerConfig.logger| Constructor and Description |
|---|
CircuitBreakerService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRPMService(RPMService rpmService) |
void |
afterHarvest(java.lang.String appName)
Called after the harvest.
|
void |
beforeHarvest(java.lang.String appName,
StatsEngine statsEngine)
Called before the harvest.
|
boolean |
checkAndTrip()
Checks memory+gc usage and trips circuit breaker if necessary.
|
void |
configChanged(java.lang.String appName,
AgentConfig agentConfig) |
static SamplingCounter |
createTracerSamplerCounter() |
protected void |
doStart() |
protected void |
doStop() |
boolean |
isEnabled()
Is the service enabled.
|
boolean |
isTripped()
Update the status if the time has come and return the status.
|
void |
removeRPMService(RPMService rpmService) |
void |
reset()
Reset circuit breaker;
|
void |
setPreviousChecksForTesting(long newGCTimeNS,
long newCpuTimeNS)
Only use for testing.
|
getLogger, getName, isStarted, isStartedOrStarting, isStopped, isStoppedOrStopping, start, stoppublic boolean isEnabled()
Serviceprotected void doStart()
throws java.lang.Exception
doStart in class AbstractServicejava.lang.Exceptionprotected void doStop()
throws java.lang.Exception
doStop in class AbstractServicejava.lang.Exceptionpublic void beforeHarvest(java.lang.String appName,
StatsEngine statsEngine)
HarvestListenerbeforeHarvest in interface HarvestListenerpublic void afterHarvest(java.lang.String appName)
HarvestListenerafterHarvest in interface HarvestListenerpublic boolean isTripped()
public void reset()
public boolean checkAndTrip()
isTripped() instead.public void configChanged(java.lang.String appName,
AgentConfig agentConfig)
configChanged in interface AgentConfigListenerpublic void addRPMService(RPMService rpmService)
public void removeRPMService(RPMService rpmService)
public void setPreviousChecksForTesting(long newGCTimeNS,
long newCpuTimeNS)
public static SamplingCounter createTracerSamplerCounter()