|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.infront.assembler.perf.serializers.PerfLogTimeEventSerializer
public class PerfLogTimeEventSerializer
An implementation of EventSerializer
that logs time taken, per request, into the assembler performance log.
Constructor Summary | |
---|---|
PerfLogTimeEventSerializer(String outputPath,
RecordedEventsConfiguration loggableEvents)
Constructs a PerfLogTimeEventSerializer with a log file count of 5 and a log file limit of 1000 (that is, 1000 megabytes). |
|
PerfLogTimeEventSerializer(String outputPath,
RecordedEventsConfiguration loggableEvents,
int logFileCount,
int logFileLimit)
Constructs a PerfLogTimeEventSerializer. |
Method Summary | |
---|---|
protected void |
createHeaderForEventSummary(StringBuilder builder,
String eventID)
Appends header text describing the event formatting and time units. |
protected List<String> |
createLoggables(RecordedEventsConfiguration loggableEvents)
Iterates through the recorded events in the input RecordedEventsConfiguration to create a list of Strings describing the events. |
protected Logger |
createLogger(String outputPath,
int logFileCount,
int logFileLimit)
Creates a Logger and sets up appropriate formatting. |
protected void |
emptySummary(StringBuilder builder)
Generates an empty summary for the event type. |
EventFactory |
getEventFactory()
Get the factory which is responsible for creating events for this serializer. |
protected void |
outputHeaderLine()
Creates the header line, which involves calling createHeaderForEventSummary(StringBuilder, String)
for each loggable entry. |
void |
serialize(Map<String,EventSummary> events,
javax.servlet.http.HttpServletRequest request)
Record performance events with this serializer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PerfLogTimeEventSerializer(String outputPath, RecordedEventsConfiguration loggableEvents) throws IOException
outputPath
- The path to the log file to output. The log file
name can contain all the wildcards supported by FileHandler
.
The parameter "%g" must be included in the file name to reflect the
number of the log file, or this value will be appended to the name.loggableEvents
- The performance events for CartridgeHandler
that this listener should output
IOException
public PerfLogTimeEventSerializer(String outputPath, RecordedEventsConfiguration loggableEvents, int logFileCount, int logFileLimit) throws IOException
outputPath
- The path to the log file to output. The log file
name can contain all the wildcards supported by FileHandler
.
The parameter "%g" must be included in the file name to reflect the
number of the log file, or this value will be appended to the name.loggableEvents
- The performance events for CartridgeHandler
that this listener should outputlogFileCount
- The number of log files to cycle through.logFileLimit
- The maximum size of a log file, in Megabytes. Once
this limit is reached, the log file will rotate.
IOException
Method Detail |
---|
protected void createHeaderForEventSummary(StringBuilder builder, String eventID)
builder
- the StringBuilder to append toeventID
- the event IDprotected void emptySummary(StringBuilder builder)
builder
- the StringBuilder to append topublic EventFactory getEventFactory()
getEventFactory
in interface EventSerializer
protected void outputHeaderLine()
createHeaderForEventSummary(StringBuilder, String)
for each loggable entry.
createLoggables(RecordedEventsConfiguration)
protected Logger createLogger(String outputPath, int logFileCount, int logFileLimit) throws IOException
outputPath
- The path to the log file to output. The log file
name can contain all the wildcards supported by FileHandler
.
The parameter "%g" must be included in the file name to reflect the
number of the log file, or this value will be appended to the name.logFileCount
- The number of log files to cycle through.logFileLimit
- The maximum size of a log file, in Megabytes. Once
this limit is reached, the log file will rotate.
IOException
- if a File
cannot be created corresponding
to the outputPath.protected List<String> createLoggables(RecordedEventsConfiguration loggableEvents)
public void serialize(Map<String,EventSummary> events, javax.servlet.http.HttpServletRequest request)
serialize
in interface EventSerializer
events
- the events to serializerequest
- the request that generated the given events.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |