public class DefaultRequestReporter extends Object implements RequestReporter
Manager.message(String). Following aspects of the class can be overridden:
reportMessage(String),isSignificantSplit(org.javasimon.Split, org.javasimon.Split),shouldBeAddedStopwatchInfo(ReporterStopwatchInfo).| Constructor and Description |
|---|
DefaultRequestReporter() |
| Modifier and Type | Method and Description |
|---|---|
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. |
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(ReporterStopwatchInfo info)
Decides whether stopwatch info should be included in the report - by default all are included.
|
public DefaultRequestReporter()
public void reportRequest(javax.servlet.http.HttpServletRequest request, Split requestSplit, List<Split> splits)
RequestReporterreportRequest 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 reportprotected 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 requestprotected boolean shouldBeAddedStopwatchInfo(ReporterStopwatchInfo info)
info - stopwatch info contains list of all splits, max split and total time of splits for the reported requestpublic void setSimonServletFilter(SimonServletFilter simonServletFilter)
RequestReporterManager is needed
(SimonServletFilter.getManager()) and possibly for other scenarios.setSimonServletFilter in interface RequestReporterCopyright © 2019. All rights reserved.