|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.javaee.reqreporter.DefaultRequestReporter
public class DefaultRequestReporter
Reports significant splits (longer than 5% of the request) and list of all used stopwatches with their split counts.
Report is sent through Manager.message(String). Following aspects of the class can be overridden:
reportMessage(String),isSignificantSplit(org.javasimon.Split, org.javasimon.Split),shouldBeAddedStopwatchInfo(DefaultRequestReporter.StopwatchInfo).
| Nested Class Summary | |
|---|---|
protected class |
DefaultRequestReporter.StopwatchInfo
|
| Field Summary | |
|---|---|
private static int |
NOTE_OUTPUT_MAX_LEN
|
private SimonServletFilter |
simonServletFilter
|
| Constructor Summary | |
|---|---|
DefaultRequestReporter()
|
|
| Method Summary | |
|---|---|
private void |
addStopwatchInfo(StringBuilder messageBuilder,
DefaultRequestReporter.StopwatchInfo info)
|
private void |
addStopwatchSplitDistribution(StringBuilder messageBuilder,
Map<String,DefaultRequestReporter.StopwatchInfo> stopwatchInfos)
|
private void |
buildSplitDetails(Split requestSplit,
List<Split> splits,
StringBuilder messageBuilder)
|
protected boolean |
isSignificantSplit(Split split,
Split requestSplit)
Can be overridden to decide whether Split is considered significant to be reported in the first part of the output. |
private void |
processSplitsAndAddSignificantOnes(Split requestSplit,
List<Split> splits,
StringBuilder messageBuilder,
Map<String,DefaultRequestReporter.StopwatchInfo> stopwatchInfos)
|
protected void |
reportMessage(String message)
Reports the prepared message through the method Manager.message(String) - can be overridden
to emit the message to log/console/etc. |
void |
reportRequest(javax.servlet.http.HttpServletRequest request,
Split requestSplit,
List<Split> splits)
Reports request that exceeds the threshold. |
void |
setSimonServletFilter(SimonServletFilter simonServletFilter)
Called by initialization after the instance creation. |
protected boolean |
shouldBeAddedStopwatchInfo(DefaultRequestReporter.StopwatchInfo info)
Decides whether stopwatch info should be included in the report - by default all are included. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int NOTE_OUTPUT_MAX_LEN
private SimonServletFilter simonServletFilter
| Constructor Detail |
|---|
public DefaultRequestReporter()
| Method Detail |
|---|
public void reportRequest(javax.servlet.http.HttpServletRequest request,
Split requestSplit,
List<Split> splits)
RequestReporter
reportRequest in interface RequestReporterrequest - offending HTTP requestrequestSplit - split measuring the offending requestsplits - list of all splits started for this requestprotected void reportMessage(String message)
Manager.message(String) - can be overridden
to emit the message to log/console/etc.
message - prepared message with report
private void buildSplitDetails(Split requestSplit,
List<Split> splits,
StringBuilder messageBuilder)
private void processSplitsAndAddSignificantOnes(Split requestSplit,
List<Split> splits,
StringBuilder messageBuilder,
Map<String,DefaultRequestReporter.StopwatchInfo> stopwatchInfos)
protected boolean isSignificantSplit(Split split,
Split requestSplit)
Split is considered significant to be reported in the first part of the output.
By default all Splits with time over 5% of total request time are significant. This includes overlapping splits too, so more than
20 splits can be reported.
split - tested SplitrequestSplit - Split for the whole HTTP request
private void addStopwatchSplitDistribution(StringBuilder messageBuilder,
Map<String,DefaultRequestReporter.StopwatchInfo> stopwatchInfos)
protected boolean shouldBeAddedStopwatchInfo(DefaultRequestReporter.StopwatchInfo info)
info - stopwatch info contains list of all splits, max split and total time of splits for the reported request
private void addStopwatchInfo(StringBuilder messageBuilder,
DefaultRequestReporter.StopwatchInfo info)
public void setSimonServletFilter(SimonServletFilter simonServletFilter)
RequestReporterManager is needed
(SimonServletFilter.getManager()) and possibly for other scenarios.
setSimonServletFilter in interface RequestReporter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||