|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.LayoutBase<ch.qos.logback.classic.spi.LoggingEvent>
org.perf4j.logback.StatisticsCsvLayout
public class StatisticsCsvLayout
A layout that outputs GroupedTimingStatistics
instances as comma-separated values. Thus, this
layout is designed to be attached to appenders that are themselves attached to an
AsyncCoalescingStatisticsAppender
.
By default, each GroupedTimingStatistics object is output as a bunch of lines, with one line for each tagged
TimingStatistics
instance contained within the GroupedTimingStatistics object. The following
"columns" are output, separated by commas:
You can modify the columns output using the Columns option. For example, you could specify the Columns option as "tag,start,stop,mean,count" to only output those specified values. In addition to the values specified above you can also use "tps" to output transactions per second.
In addition to the default output of one line per tag for each GroupedTimingStatistics object, this layout also supports a Pivot option which outputs just a single line for an entire GroupedTimingStatistics object. When pivot is true you should set the Columns to specify the values from the specific tags you want to output. For example, setting Pivot to true and setting Columns to "start,stop,codeBlock1Mean,codeBlock2Mean" would cause, for each GroupedTimingStatistics object, a single line to be output with the start and stop times of the window, the mean execution time for all stop watch logs with a codeBlock1 tag, and the mean execution time for all stop watch logs with a codeBlock2 tag.
Field Summary | |
---|---|
protected GroupedTimingStatisticsCsvFormatter |
csvFormatter
The csvFormatter is created in the start() method. |
Fields inherited from class ch.qos.logback.core.LayoutBase |
---|
started |
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase |
---|
context |
Constructor Summary | |
---|---|
StatisticsCsvLayout()
|
Method Summary | |
---|---|
String |
doLayout(ch.qos.logback.classic.spi.LoggingEvent event)
|
String |
getColumns()
The Columns option is a comma-separated list of the values that should be output for each line that is printed. |
boolean |
isPivot()
The Pivot option, which is false by default, determines whether or not a single line will be output for each GroupedTimingStatistics object, or whether one line for each tag within a GroupedTimingStatistics object will be output. |
boolean |
isPrintNonStatistics()
Gets the value of the PrintNonStatistics option. |
void |
setColumns(String columns)
Sets the value of the Columns option. |
void |
setPivot(boolean pivot)
Sets the value of the Pivot option. |
void |
setPrintNonStatistics(boolean printNonStatistics)
Sets the value of the PrintNonStatistics option. |
void |
start()
|
Methods inherited from class ch.qos.logback.core.LayoutBase |
---|
getContentType, getContext, getFileFooter, getFileHeader, getPresentationFooter, getPresentationHeader, isStarted, setContext, setFileFooter, setFileHeader, setPresentationFooter, setPresentationHeader, stop |
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase |
---|
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getStatusManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ch.qos.logback.core.spi.ContextAware |
---|
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn |
Field Detail |
---|
protected GroupedTimingStatisticsCsvFormatter csvFormatter
start()
method. The work of actually formatting the
GroupedTimingStatistics object is delegated to this object.
Constructor Detail |
---|
public StatisticsCsvLayout()
Method Detail |
---|
public boolean isPivot()
public void setPivot(boolean pivot)
pivot
- The new Pivot option value.public String getColumns()
public void setColumns(String columns)
columns
- The new Columns option value.public boolean isPrintNonStatistics()
AsyncCoalescingStatisticsAppender
). By default, any logging event where the message is NOT a
GroupedTimingStatistics object is not output. However, if this option is set to true, then
non-GroupedTimingStatistics messages will be output as their string value.
public void setPrintNonStatistics(boolean printNonStatistics)
printNonStatistics
- The new PrintNonStatistics option value.public String doLayout(ch.qos.logback.classic.spi.LoggingEvent event)
public void start()
start
in interface ch.qos.logback.core.spi.LifeCycle
start
in class ch.qos.logback.core.LayoutBase<ch.qos.logback.classic.spi.LoggingEvent>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |