public class ErrorServiceImpl extends AbstractService implements ErrorService, HarvestListener
| Modifier and Type | Field and Description |
|---|---|
protected Harvestable |
harvestable |
logger| Constructor and Description |
|---|
ErrorServiceImpl(java.lang.String appName)
Note that an instance of this class is created for each RPMService, which is a side effect of using
auto app naming and the servlet instrumentation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHarvestableToService() |
void |
afterHarvest(java.lang.String appName)
Called after the harvest.
|
void |
beforeHarvest(java.lang.String appName,
StatsEngine statsEngine)
Called before the harvest.
|
void |
clearReservoir()
Reset the event reservoir to allow for the next harvest to start
|
void |
clearReservoir(java.lang.String appName) |
protected static com.newrelic.agent.model.ErrorEvent |
createErrorEvent(java.lang.String theAppName,
TracedError error,
TransactionData transactionData,
TransactionStats transactionStats) |
protected void |
doStart() |
protected void |
doStop() |
java.util.List<TracedError> |
getAndClearTracedErrors()
Get the traced errors for this reporting period.
|
static java.util.Collection<? extends PointCut> |
getEnabledErrorHandlerPointCuts() |
ErrorAnalyzer |
getErrorAnalyzer() |
ErrorCollectorConfig |
getErrorCollectorConfig() |
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.ErrorEvent> |
getReservoir(java.lang.String appName) |
int |
getTracedErrorsCount() |
void |
harvestEvents(java.lang.String appName)
Perform the harvest of any pending events right now.
|
void |
harvestTracedErrors(java.lang.String appName,
StatsEngine statsEngine) |
boolean |
isEnabled()
Is the service enabled.
|
void |
refreshErrorCollectorConfig(AgentConfig agentConfig) |
void |
reportError(java.lang.String message,
java.util.Map<java.lang.String,?> params,
boolean expected) |
void |
reportError(TracedError error) |
protected void |
reportError(TracedError error,
TransactionData transactionData,
TransactionStats transactionStats) |
void |
reportErrors(TracedError... errors) |
void |
reportException(java.lang.Throwable throwable)
Checks if exception should be ignored.
|
void |
reportException(java.lang.Throwable throwable,
java.util.Map<java.lang.String,?> params,
boolean expected)
Report an exception to New Relic.
|
void |
reportHTTPError(java.lang.String message,
int statusCode,
java.lang.String uri) |
void |
setHarvestable(Harvestable harvestable) |
void |
setMaxSamplesStored(int maxSamplesStored)
Update the current limit of events to store per harvest interval.
|
getLogger, getName, isStarted, isStartedOrStarting, isStopped, isStoppedOrStopping, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLogger, getName, isStarted, isStartedOrStarting, isStopped, isStoppedOrStopping, start, stopprotected Harvestable harvestable
public ErrorServiceImpl(java.lang.String appName)
protected void doStart()
throws java.lang.Exception
doStart in class AbstractServicejava.lang.Exceptionpublic boolean isEnabled()
Serviceprotected void doStop()
throws java.lang.Exception
doStop in class AbstractServicejava.lang.Exceptionpublic void addHarvestableToService()
addHarvestableToService in interface ErrorServicepublic ErrorCollectorConfig getErrorCollectorConfig()
public 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 setHarvestable(Harvestable harvestable)
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 void harvestTracedErrors(java.lang.String appName,
StatsEngine statsEngine)
public void refreshErrorCollectorConfig(AgentConfig agentConfig)
public void reportErrors(TracedError... errors)
reportErrors in interface ErrorServicepublic void reportError(TracedError error)
reportError in interface ErrorServiceprotected void reportError(TracedError error, TransactionData transactionData, TransactionStats transactionStats)
protected static com.newrelic.agent.model.ErrorEvent createErrorEvent(java.lang.String theAppName,
TracedError error,
TransactionData transactionData,
TransactionStats transactionStats)
public java.util.List<TracedError> getAndClearTracedErrors()
getAndClearTracedErrors in interface ErrorServicepublic ErrorAnalyzer getErrorAnalyzer()
public int getTracedErrorsCount()
public DistributedSamplingPriorityQueue<com.newrelic.agent.model.ErrorEvent> getReservoir(java.lang.String appName)
public void reportException(java.lang.Throwable throwable)
reportException in interface ErrorServicepublic void reportException(java.lang.Throwable throwable,
java.util.Map<java.lang.String,?> params,
boolean expected)
reportException in interface ErrorServicepublic void reportError(java.lang.String message,
java.util.Map<java.lang.String,?> params,
boolean expected)
reportError in interface ErrorServicepublic void beforeHarvest(java.lang.String appName,
StatsEngine statsEngine)
HarvestListenerbeforeHarvest in interface HarvestListenerpublic void afterHarvest(java.lang.String appName)
HarvestListenerafterHarvest in interface HarvestListenerpublic static java.util.Collection<? extends PointCut> getEnabledErrorHandlerPointCuts()
public void reportHTTPError(java.lang.String message,
int statusCode,
java.lang.String uri)
reportHTTPError in interface ErrorService