public class InsightsServiceImpl extends AbstractService implements InsightsService
Modifier and Type | Class and Description |
---|---|
static class |
InsightsServiceImpl.TransactionInsights |
Modifier and Type | Field and Description |
---|---|
protected AgentConfigListener |
configListener |
protected ExtendedTransactionListener |
transactionListener |
logger
Constructor and Description |
---|
InsightsServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addHarvestableToService(java.lang.String appName) |
void |
clearReservoir()
Reset the event reservoir to allow for the next harvest to start
|
void |
clearReservoir(java.lang.String appName) |
protected void |
doStart() |
protected void |
doStop() |
java.lang.String |
getEventHarvestIntervalMetric()
Returns the metric name for this service that records the actual interval in which the harvest is happening.
|
java.lang.String |
getEventHarvestLimitMetric()
Returns the metric name for this service that records the harvest limit.
|
int |
getMaxSamplesStored()
Returns the current limit of events to store per harvest interval.
|
java.lang.String |
getReportPeriodInSecondsMetric()
Returns the metric name for this service that records the expected report period.
|
DistributedSamplingPriorityQueue<com.newrelic.agent.model.CustomInsightsEvent> |
getReservoir(java.lang.String appName) |
com.newrelic.api.agent.Insights |
getTransactionInsights(AgentConfig config)
Returns an insights instance used to track events created during a transaction.
|
void |
harvestEvents(java.lang.String appName)
Perform the harvest of any pending events right now.
|
void |
harvestHarvestables() |
void |
harvestPendingEvents() |
boolean |
isEnabled()
Is the service enabled.
|
void |
recordCustomEvent(java.lang.String eventType,
java.util.Map<java.lang.String,?> attributes) |
void |
setMaxSamplesStored(int maxSamplesStored)
Update the current limit of events to store per harvest interval.
|
void |
storeEvent(java.lang.String appName,
com.newrelic.agent.model.CustomInsightsEvent event)
Store event into Reservoir following usual sampling using the given appName.
|
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
protected final ExtendedTransactionListener transactionListener
protected final AgentConfigListener configListener
public boolean isEnabled()
Service
protected void doStart() throws java.lang.Exception
doStart
in class AbstractService
java.lang.Exception
protected void doStop() throws java.lang.Exception
doStop
in class AbstractService
java.lang.Exception
public void recordCustomEvent(java.lang.String eventType, java.util.Map<java.lang.String,?> attributes)
recordCustomEvent
in interface com.newrelic.api.agent.Insights
public void addHarvestableToService(java.lang.String appName)
addHarvestableToService
in interface InsightsService
public int getMaxSamplesStored()
EventService
getMaxSamplesStored
in interface EventService
public void setMaxSamplesStored(int maxSamplesStored)
EventService
setMaxSamplesStored
in interface EventService
maxSamplesStored
- the new maximum number of events to store per harvest interval.public void clearReservoir()
EventService
clearReservoir
in interface EventService
public void clearReservoir(java.lang.String appName)
public void harvestHarvestables()
public void harvestPendingEvents()
public void storeEvent(java.lang.String appName, com.newrelic.agent.model.CustomInsightsEvent event)
InsightsService
storeEvent
in interface InsightsService
public DistributedSamplingPriorityQueue<com.newrelic.agent.model.CustomInsightsEvent> getReservoir(java.lang.String appName)
public void harvestEvents(java.lang.String appName)
EventService
harvestEvents
in interface EventService
appName
- the application to harvest forpublic java.lang.String getEventHarvestIntervalMetric()
EventService
getEventHarvestIntervalMetric
in interface EventService
public java.lang.String getReportPeriodInSecondsMetric()
EventService
getReportPeriodInSecondsMetric
in interface EventService
public java.lang.String getEventHarvestLimitMetric()
EventService
getEventHarvestLimitMetric
in interface EventService
public com.newrelic.api.agent.Insights getTransactionInsights(AgentConfig config)
InsightsService
getTransactionInsights
in interface InsightsService