public class CommandProcessorMetrics extends Object implements Serializable
CommandProcessor.
The processor object is the only object that can update metric data
held in this object and it will do so in a thread-safe manner.
Objects that read data from this object automatically do so in a thread-safe manner,
but the callers may get inconsistent data if the processor updates data
in between calling multiple getters - but this isn't dangerous
so we'll leave it as is (the individual getters makes it easy to expose
this information as individual metrics so we can graph them).
But the locking done here helps minimize those instances where metric data
looks inconsistent to callers.| Modifier and Type | Class and Description |
|---|---|
class |
CommandProcessorMetrics.Calltime
Used to store the minimum, maximum and average times (in milliseconds)
for invocations to a particular command.
|
static class |
CommandProcessorMetrics.UnsuccessfulReason |
| Constructor and Description |
|---|
CommandProcessorMetrics() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Resets all the metric data to 0 and clears the calltime data.
|
long |
getAverageExecutionTime()
Returns the average execution time (in milliseconds) it took to execute all
successful commands. |
Map<String,CommandProcessorMetrics.Calltime> |
getCallTimeData()
Return the calltime data that includes the different command types/pojo invocations.
|
long |
getNumberDroppedCommands()
Returns the total number of commands that were received but were not permitted to be executed and were dropped.
|
long |
getNumberFailedCommands()
Returns the total number of commands that were received but failed to be processed succesfully.
|
long |
getNumberNotProcessedCommands()
Returns the total number of commands that were received but were not processed.
|
long |
getNumberSuccessfulCommands()
Returns the total number of commands that were received and processed succesfully.
|
public void clear()
public Map<String,CommandProcessorMetrics.Calltime> getCallTimeData()
public long getNumberFailedCommands()
not successful. This does not count
dropped or
unprocessed commands.public long getNumberDroppedCommands()
public long getNumberNotProcessedCommands()
public long getNumberSuccessfulCommands()
succesful.public long getAverageExecutionTime()
successful commands.Copyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.