org.rhq.enterprise.communications.command.client
Class ClientCommandSenderMetrics

java.lang.Object
  extended by org.rhq.enterprise.communications.command.client.ClientCommandSenderMetrics

public class ClientCommandSenderMetrics
extends Object

This is a simple object that encapsulates all the different metrics collected by a single sender.

This class is thread-safe.

Author:
John Mazzitelli

Constructor Summary
ClientCommandSenderMetrics()
          Constructor for ClientCommandSenderMetrics that represents a "dummy" sender.
ClientCommandSenderMetrics(org.rhq.enterprise.communications.command.client.CommandQueue queue, PersistentFifo commandStore, ThreadPoolExecutor threadPool)
          Creates a new ClientCommandSenderMetrics object given the queue and store used by the sender object whose metrics this object contains.
 
Method Summary
 long getAverageExecutionTimeSent()
          Returns the amount of time (in milliseconds) that it took to send all commands that were ultimately successful.
 long getNumberCommandsActive()
          Returns the number of commands that are currently being processed.
 long getNumberCommandsInQueue()
          Returns the approximate number of commands that are currently in the queue waiting to be sent.
 long getNumberCommandsSpooled()
          Returns the number of commands that are currently spooled to disk (which tells you the number of guaranteed commands that failed to be sent and are waiting to be retried.
 long getNumberFailedCommandsSent()
          Returns the number of commands that failed to be sent successfully.
 long getNumberSuccessfulCommandsSent()
          Returns the number of commands that were successfully sent.
 long getQueueThrottleBurstPeriodMillis()
          See ClientCommandSender.enableQueueThrottling(long, long).
 long getQueueThrottleMaxCommands()
          See ClientCommandSender.enableQueueThrottling(long, long).
 long getSendThrottleMaxCommands()
          See ClientCommandSender.enableSendThrottling(long, long).
 long getSendThrottleQuietPeriodDurationMillis()
          See ClientCommandSender.enableSendThrottling(long, long).
 boolean isSending()
          Indicates if the sender object is currently in "sending" mode.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientCommandSenderMetrics

public ClientCommandSenderMetrics(org.rhq.enterprise.communications.command.client.CommandQueue queue,
                                  PersistentFifo commandStore,
                                  ThreadPoolExecutor threadPool)
Creates a new ClientCommandSenderMetrics object given the queue and store used by the sender object whose metrics this object contains.

Parameters:
queue - the sender's queue (may be null)
commandStore - the place where guaranteed commands are persisted (may be null)
threadPool - contains the threads that execute the queued tasks (may be null)

ClientCommandSenderMetrics

public ClientCommandSenderMetrics()
Constructor for ClientCommandSenderMetrics that represents a "dummy" sender. Both the queue and command store are assumed null so their sizes will always be assumed 0. This constructor is used to simulate metrics for a sender that has been shutdown.

Method Detail

getNumberCommandsActive

public long getNumberCommandsActive()
Returns the number of commands that are currently being processed.

Returns:
commands that are actively in progress

getNumberSuccessfulCommandsSent

public long getNumberSuccessfulCommandsSent()
Returns the number of commands that were successfully sent.

Returns:
number of commands sent

getNumberFailedCommandsSent

public long getNumberFailedCommandsSent()
Returns the number of commands that failed to be sent successfully. This counts those commands that failed to reach the server and those that did reach the server but were not successfully processed by the server.

Returns:
number of failed commands

getAverageExecutionTimeSent

public long getAverageExecutionTimeSent()
Returns the amount of time (in milliseconds) that it took to send all commands that were ultimately successful.

Returns:
average time the successful commands took to complete

getNumberCommandsInQueue

public long getNumberCommandsInQueue()
Returns the approximate number of commands that are currently in the queue waiting to be sent.

Returns:
number of commands queued

getNumberCommandsSpooled

public long getNumberCommandsSpooled()
Returns the number of commands that are currently spooled to disk (which tells you the number of guaranteed commands that failed to be sent and are waiting to be retried.

Returns:
number of persisted commands
See Also:
PersistentFifo

isSending

public boolean isSending()
Indicates if the sender object is currently in "sending" mode. If true, this means the sender thinks the server on the other end is alive and is able to send messages to it.

Returns:
sending mode flag

getQueueThrottleMaxCommands

public long getQueueThrottleMaxCommands()
See ClientCommandSender.enableQueueThrottling(long, long).

Returns:
maximum commands allowed by the queue throttle (0 if queue throttling is disabled)

getQueueThrottleBurstPeriodMillis

public long getQueueThrottleBurstPeriodMillis()
See ClientCommandSender.enableQueueThrottling(long, long).

Returns:
queue throttle burst period, in milliseconds (0 if queue throttling is disabled)

getSendThrottleMaxCommands

public long getSendThrottleMaxCommands()
See ClientCommandSender.enableSendThrottling(long, long).

Returns:
maximum commands allowed by the send throttle (0 if send throttling is disabled)

getSendThrottleQuietPeriodDurationMillis

public long getSendThrottleQuietPeriodDurationMillis()
See ClientCommandSender.enableSendThrottling(long, long).

Returns:
send throttle quiet period duration, in milliseconds (0 if send throttling is disabled)

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


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