|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.messaging.core.messagecounter.MessageCounter
public class MessageCounter
This class stores message count informations for a given queue At intervals this class samples the queue for message count data Note that the underlying queue *does not* update statistics every time a message is added since that would reall slow things down, instead we *sample* the queues at regular intervals - this means we are less intrusive on the queue
Field Summary | |
---|---|
protected static Logger |
log
|
Constructor Summary | |
---|---|
MessageCounter(java.lang.String name,
Queue queue,
boolean durable,
int daycountmax)
Constructor |
Method Summary | |
---|---|
java.lang.String |
getCounterAsString()
Get message counter data as string in format "Topic/Queue, Name, Subscription, Durable, Count, CountDelta, Depth, DepthDelta, Timestamp Last Increment" |
int |
getCurrentMessageCount()
|
boolean |
getDestinationDurable()
Gets the related destination durable subscription flag |
java.lang.String |
getDestinationName()
Gets the related destination name |
java.lang.String |
getHistoryAsString()
Get message counter history data as string in format "day count\n Date 1, hour counter 0, hour counter 1, ..., hour counter 23\n Date 2, hour counter 0, hour counter 1, ..., hour counter 23\n ..... |
int |
getHistoryLimit()
Get message counter history day count limit <0: unlimited, 0: history disabled, >0: day count |
long |
getLastUpdate()
Gets the timestamp of the last message add |
int |
getMessageCount()
Gets the current message count of pending messages within the destination waiting for dispatch |
int |
getTotalMessages()
|
void |
resetCounter()
Reset message counter values |
void |
resetHistory()
Reset message counter history |
void |
sample()
|
void |
setHistoryLimit(int daycountmax)
Set message counter history day count limit <0: unlimited, 0: history disabled, >0: day count |
java.lang.String |
toString()
Get string representation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final Logger log
Constructor Detail |
---|
public MessageCounter(java.lang.String name, Queue queue, boolean durable, int daycountmax)
name
- destination namequeue
- internal queue objectdurable
- durable subsciption flagdaycountmax
- max message history day countMethod Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public void sample()
public java.lang.String getDestinationName()
public boolean getDestinationDurable()
public int getTotalMessages()
public int getCurrentMessageCount()
public int getMessageCount()
public long getLastUpdate()
public void resetCounter()
public java.lang.String getCounterAsString()
public int getHistoryLimit()
public void setHistoryLimit(int daycountmax)
public void resetHistory()
public java.lang.String getHistoryAsString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |