org.rhq.enterprise.communications.command.server
Class CommandProcessorMetrics

java.lang.Object
  extended by org.rhq.enterprise.communications.command.server.CommandProcessorMetrics
All Implemented Interfaces:
Serializable

public class CommandProcessorMetrics
extends Object
implements Serializable

Contains the statistics collected by the 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.

Author:
John Mazzitelli
See Also:
Serialized Form

Nested Class Summary
 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 Summary
CommandProcessorMetrics()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandProcessorMetrics

public CommandProcessorMetrics()
Method Detail

clear

public void clear()
Resets all the metric data to 0 and clears the calltime data.


getCallTimeData

public Map<String,CommandProcessorMetrics.Calltime> getCallTimeData()
Return the calltime data that includes the different command types/pojo invocations. Note that the calltime min/max/avg times are only for the calls that were successful.

Returns:
calltime data

getNumberFailedCommands

public long getNumberFailedCommands()
Returns the total number of commands that were received but failed to be processed succesfully. This count is incremented when a command was executed by its command service but the command response was not successful. This does not count dropped or unprocessed commands.

Returns:
count of failed commands

getNumberDroppedCommands

public long getNumberDroppedCommands()
Returns the total number of commands that were received but were not permitted to be executed and were dropped. This normally occurs when the limit of concurrent command invocations has been reached.

Returns:
count of commands not permitted to complete

getNumberNotProcessedCommands

public long getNumberNotProcessedCommands()
Returns the total number of commands that were received but were not processed. This normally occurs when global processing of commands has been suspended.

Returns:
count of commands not processed.

getNumberSuccessfulCommands

public long getNumberSuccessfulCommands()
Returns the total number of commands that were received and processed succesfully. This count is incremented when a command was executed by its command service and the command response was succesful.

Returns:
count of commands succesfully processed

getAverageExecutionTime

public long getAverageExecutionTime()
Returns the average execution time (in milliseconds) it took to execute all successful commands.

Returns:
average execute time for all successful commands.


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.