public class MetricReportingServiceImpl extends Object implements MetricReportingServiceSPI, MetricEventRouter, StatementLifecycleObserver
Reports for all statements even if not in a statement group, i.e. statement in default group.
Constructor and Description |
---|
MetricReportingServiceImpl(ConfigurationMetricsReporting specification,
String engineUri)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
accountOutput(StatementMetricHandle handle,
int numIStream,
int numRStream)
Account for statement output row counting.
|
void |
accountTime(StatementMetricHandle metricsHandle,
long deltaCPU,
long deltaWall,
int numInputEvents)
Account for statement CPU and wall time.
|
void |
addStatementResultListener(StatementResultListener listener)
Add stmt result listener.
|
void |
destroy()
Destroy the service.
|
StatementMetricHandle |
getStatementHandle(int statementId,
String statementName)
Returns for a new statement a handle for later accounting.
|
CopyOnWriteArraySet<StatementResultListener> |
getStatementOutputHooks()
Returns output hooks.
|
void |
observe(StatementLifecycleEvent theEvent)
Observer statement state changes.
|
void |
processTimeEvent(long timeEventTime)
Indicates current engine time.
|
void |
removeStatementResultListener(StatementResultListener listener)
Remove stmt result listener.
|
void |
route(MetricEvent metricEvent)
Process metric event.
|
void |
setContext(EPRuntime runtime,
EPServicesContext servicesContext)
Sets runtime and services.
|
void |
setMetricsReportingDisabled()
Disables metrics reporting globally.
|
void |
setMetricsReportingEnabled()
Enables metrics reporting globally.
|
void |
setMetricsReportingInterval(String stmtGroupName,
long newInterval)
Change the reporting interval for the given statement group name.
|
void |
setMetricsReportingStmtDisabled(String statementName)
Disable metrics reporting for statement.
|
void |
setMetricsReportingStmtEnabled(String statementName)
Enable metrics reporting for statement.
|
public MetricReportingServiceImpl(ConfigurationMetricsReporting specification, String engineUri)
specification
- configurationengineUri
- engine URIpublic void addStatementResultListener(StatementResultListener listener)
MetricReportingServiceSPI
addStatementResultListener
in interface MetricReportingServiceSPI
listener
- to addpublic void removeStatementResultListener(StatementResultListener listener)
MetricReportingServiceSPI
removeStatementResultListener
in interface MetricReportingServiceSPI
listener
- to removepublic CopyOnWriteArraySet<StatementResultListener> getStatementOutputHooks()
MetricReportingServiceSPI
getStatementOutputHooks
in interface MetricReportingServiceSPI
public void setContext(EPRuntime runtime, EPServicesContext servicesContext)
MetricReportingService
setContext
in interface MetricReportingService
runtime
- runtimeservicesContext
- servicespublic void processTimeEvent(long timeEventTime)
MetricReportingService
processTimeEvent
in interface MetricReportingService
timeEventTime
- engine timepublic void destroy()
MetricReportingService
destroy
in interface MetricReportingService
public void route(MetricEvent metricEvent)
MetricEventRouter
route
in interface MetricEventRouter
metricEvent
- metric event to processpublic void accountTime(StatementMetricHandle metricsHandle, long deltaCPU, long deltaWall, int numInputEvents)
MetricReportingService
accountTime
in interface MetricReportingService
metricsHandle
- statement handledeltaCPU
- cpu time nsecdeltaWall
- wall time nsecnumInputEvents
- number of input rowspublic void accountOutput(StatementMetricHandle handle, int numIStream, int numRStream)
MetricReportingService
accountOutput
in interface MetricReportingService
handle
- statement handlenumIStream
- number of insert stream rowsnumRStream
- number of remove stream rowspublic StatementMetricHandle getStatementHandle(int statementId, String statementName)
MetricReportingService
getStatementHandle
in interface MetricReportingService
statementId
- statement idstatementName
- statement namepublic void observe(StatementLifecycleEvent theEvent)
StatementLifecycleObserver
observe
in interface StatementLifecycleObserver
theEvent
- indicates statement changedpublic void setMetricsReportingInterval(String stmtGroupName, long newInterval)
MetricReportingService
setMetricsReportingInterval
in interface MetricReportingService
stmtGroupName
- group namenewInterval
- new interval, or zero or negative value to disable reportingpublic void setMetricsReportingStmtDisabled(String statementName) throws ConfigurationException
MetricReportingService
setMetricsReportingStmtDisabled
in interface MetricReportingService
statementName
- statement nameConfigurationException
public void setMetricsReportingStmtEnabled(String statementName) throws ConfigurationException
MetricReportingService
setMetricsReportingStmtEnabled
in interface MetricReportingService
statementName
- statement nameConfigurationException
public void setMetricsReportingEnabled()
MetricReportingService
setMetricsReportingEnabled
in interface MetricReportingService
public void setMetricsReportingDisabled()
MetricReportingService
setMetricsReportingDisabled
in interface MetricReportingService