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_LIMITS |
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, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLogger, getName, isStarted, isStartedOrStarting, isStopped, isStoppedOrStopping, start, stoppublic static final java.lang.String HARVEST_THREAD_NAME
public static final java.lang.String FASTER_HARVEST_THREAD_NAME
public static final java.lang.String HARVEST_LIMITS
public boolean isEnabled()
Serviceprotected void doStart()
doStart in class AbstractServicepublic void startHarvest(IRPMService rpmService)
startHarvest in interface HarvestServicepublic void startHarvestables(IRPMService rpmService, AgentConfig config)
public void stopHarvest(IRPMService rpmService)
stopHarvest in interface HarvestServicepublic void addHarvestable(Harvestable harvestable)
addHarvestable in interface HarvestServicepublic void removeHarvestable(Harvestable harvestable)
removeHarvestable in interface HarvestServicepublic void removeHarvestablesByAppName(java.lang.String appName)
removeHarvestablesByAppName in interface HarvestServicepublic void addHarvestListener(HarvestListener listener)
addHarvestListener in interface HarvestServicelistener - public void removeHarvestListener(HarvestListener listener)
removeHarvestListener in interface HarvestServicelistener - protected void doStop()
doStop in class AbstractServicepublic long getInitialDelay()
Tests can override.
public void setInitialDelayMillis(long millis)
millis - number of milliseconds to waitpublic long getReportingPeriod()
Tests can override.
public long getMinHarvestInterval()
Tests can override.
public void harvestNow()
harvestNow in interface HarvestServicepublic java.util.Map<java.lang.String,java.lang.Object> getEventDataHarvestLimits()
HarvestServicegetEventDataHarvestLimits in interface HarvestService