|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.perf4j.helpers.GenericAsyncCoalescingStatisticsAppender
public class GenericAsyncCoalescingStatisticsAppender
This class provides the implementation for the AsyncCoalescingStatisticsAppenders made available for different logging frameworks. This class itself is generic in that it does not use any logging-framework-sppecific APIs, but is intended to be wrapped by classes that DO use those specific APIs.
AsyncCoalescingStatisticsAppender
Nested Class Summary | |
---|---|
static interface |
GenericAsyncCoalescingStatisticsAppender.GroupedTimingStatisticsHandler
The GroupedTimingStatisticsHandler defines a callback interface so that logging-framework-specific implementations can decide what to do with the coalesced GroupedTimingStatistics. |
Constructor Summary | |
---|---|
GenericAsyncCoalescingStatisticsAppender()
|
Method Summary | |
---|---|
void |
append(String message)
The append method should be called each time a StopWatch log message is handled by the logging framework. |
String |
getName()
The name of this appender. |
int |
getNumDiscardedMessages()
Returns the number of StopWatch messages that have been discarded due to the queue being full. |
int |
getQueueSize()
The QueueSize option is used to control the size of the internal queue used by this appender to store logged messages before they are sent to downstream appenders. |
String |
getStopWatchParserClassName()
The StopWatchParserClassName option is used to determine the class used to parse stop watch messages into StopWatch instances. |
long |
getTimeSlice()
The TimeSlice option represents the length of time, in milliseconds, of the window in which appended log events are coalesced to a single GroupedTimingStatistics and sent to the GroupedTimingStatisticsHandler. |
boolean |
isCreateRollupStatistics()
The CreateRollupStatistics option is used to determine whether "rollup" statistics should be created. |
void |
setCreateRollupStatistics(boolean createRollupStatistics)
Sets the value of the CreateRollupStatistics option. |
void |
setName(String name)
Sets the name of this appender. |
void |
setQueueSize(int queueSize)
Sets the value of the QueueSize option. |
void |
setStopWatchParserClassName(String stopWatchParserClassName)
Sets the value of the StopWatchParserClassName option. |
void |
setTimeSlice(long timeSlice)
Sets the value of the TimeSlice option. |
void |
start(GenericAsyncCoalescingStatisticsAppender.GroupedTimingStatisticsHandler handler)
The start method should only be called once, before the append method is called, to initialize options. |
void |
stop()
This method should be called on shutdown to flush any pending messages in the queue and create a final GroupedTimingStatistics instance if necessary. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericAsyncCoalescingStatisticsAppender()
Method Detail |
---|
public String getName()
public void setName(String name)
name
- The new appender name.public long getTimeSlice()
public void setTimeSlice(long timeSlice)
timeSlice
- The new TimeSlice option, in milliseconds.public boolean isCreateRollupStatistics()
public void setCreateRollupStatistics(boolean createRollupStatistics)
createRollupStatistics
- The new CreateRollupStatistics option.public int getQueueSize()
getNumDiscardedMessages()
method.
public void setQueueSize(int queueSize)
queueSize
- The new QueueSize option.public String getStopWatchParserClassName()
public void setStopWatchParserClassName(String stopWatchParserClassName)
stopWatchParserClassName
- The new StopWatchParserClassName option.public int getNumDiscardedMessages()
public void start(GenericAsyncCoalescingStatisticsAppender.GroupedTimingStatisticsHandler handler)
handler
- The GroupedTimingStatisticsHandler used to process GroupedTimingStatistics created by aggregating
StopWatch log message.public void append(String message)
message
- The log message, may not be null. If this message is not a valid StopWatch log message it will
be discarded.public void stop()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |