public class HarvestServiceImpl extends AbstractService implements HarvestService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FASTER_HARVEST_THREAD_NAME |
static java.lang.String |
HARVEST_THREAD_NAME |
logger
Constructor and Description |
---|
HarvestServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addHarvestable(Harvestable harvestable) |
void |
addHarvestListener(HarvestListener listener)
Add a listener that will be called by the harvest tasks before and after metric data is sent.
|
protected void |
doStart() |
protected void |
doStop() |
java.util.Map<java.lang.String,java.lang.Object> |
getEventDataHarvestLimits()
Returns the object structure that will be marshaled to JSON for `event_harvest_config` that will get sent
up on connect.
|
long |
getInitialDelay()
Get the initial delay in milliseconds.
|
long |
getMinHarvestInterval()
Get the minimum harvest interval in nanoseconds.
|
long |
getReportingPeriod()
Get the reporting period in milliseconds.
|
void |
harvestNow()
Run harvests now.
|
boolean |
isEnabled()
Is the service enabled.
|
void |
removeHarvestable(Harvestable harvestable) |
void |
removeHarvestablesByAppName(java.lang.String appName) |
void |
removeHarvestListener(HarvestListener listener)
Remove a listener.
|
void |
setInitialDelayMillis(long millis)
Override the initial delay.
|
void |
startHarvest(IRPMService rpmService)
Start a harvest task for the RPM service (or restart it if the reporting period has changed).
|
void |
startHarvestables(IRPMService rpmService,
AgentConfig config) |
void |
stopHarvest(IRPMService rpmService)
Stop a harvest task for the RPM service
|
getLogger, getName, isStarted, isStartedOrStarting, isStopped, isStoppedOrStopping, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLogger, getName, isStarted, isStartedOrStarting, isStopped, isStoppedOrStopping, start, stop
public static final java.lang.String HARVEST_THREAD_NAME
public static final java.lang.String FASTER_HARVEST_THREAD_NAME
public boolean isEnabled()
Service
protected void doStart()
doStart
in class AbstractService
public void startHarvest(IRPMService rpmService)
startHarvest
in interface HarvestService
public void startHarvestables(IRPMService rpmService, AgentConfig config)
public void stopHarvest(IRPMService rpmService)
stopHarvest
in interface HarvestService
public void addHarvestable(Harvestable harvestable)
addHarvestable
in interface HarvestService
public void removeHarvestable(Harvestable harvestable)
removeHarvestable
in interface HarvestService
public void removeHarvestablesByAppName(java.lang.String appName)
removeHarvestablesByAppName
in interface HarvestService
public void addHarvestListener(HarvestListener listener)
addHarvestListener
in interface HarvestService
listener
- public void removeHarvestListener(HarvestListener listener)
removeHarvestListener
in interface HarvestService
listener
- protected void doStop()
doStop
in class AbstractService
public long getInitialDelay()
public void setInitialDelayMillis(long millis)
millis
- number of milliseconds to waitpublic long getReportingPeriod()
public long getMinHarvestInterval()
public void harvestNow()
harvestNow
in interface HarvestService
public java.util.Map<java.lang.String,java.lang.Object> getEventDataHarvestLimits()
HarvestService
getEventDataHarvestLimits
in interface HarvestService