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, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetReportPeriodInMillisgetLogger, getName, isStarted, isStartedOrStarting, isStopped, isStoppedOrStopping, start, stopprotected final ExtendedTransactionListener transactionListener
protected final AgentConfigListener configListener
public 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 recordCustomEvent(java.lang.String eventType,
java.util.Map<java.lang.String,?> attributes)
recordCustomEvent in interface com.newrelic.api.agent.Insightspublic void addHarvestableToService(java.lang.String appName)
addHarvestableToService in interface InsightsServicepublic int getMaxSamplesStored()
EventServicegetMaxSamplesStored in interface EventServicepublic void setMaxSamplesStored(int maxSamplesStored)
EventServicesetMaxSamplesStored in interface EventServicemaxSamplesStored - the new maximum number of events to store per harvest interval.public void clearReservoir()
EventServiceclearReservoir in interface EventServicepublic 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)
InsightsServicestoreEvent in interface InsightsServicepublic DistributedSamplingPriorityQueue<com.newrelic.agent.model.CustomInsightsEvent> getReservoir(java.lang.String appName)
public void harvestEvents(java.lang.String appName)
EventServiceharvestEvents in interface EventServiceappName - the application to harvest forpublic java.lang.String getEventHarvestIntervalMetric()
EventServicegetEventHarvestIntervalMetric in interface EventServicepublic java.lang.String getReportPeriodInSecondsMetric()
EventServicegetReportPeriodInSecondsMetric in interface EventServicepublic java.lang.String getEventHarvestLimitMetric()
EventServicegetEventHarvestLimitMetric in interface EventServicepublic com.newrelic.api.agent.Insights getTransactionInsights(AgentConfig config)
InsightsServicegetTransactionInsights in interface InsightsService