org.e2etrace.formatter
Class CSVTraceFormatter

java.lang.Object
  extended by org.e2etrace.formatter.AbstractTraceFormatter
      extended by org.e2etrace.formatter.CSVTraceFormatter
All Implemented Interfaces:
ITraceFormatter

public class CSVTraceFormatter
extends AbstractTraceFormatter

CSV trace formatter.

This formatter generates a CSV stream from the data of a trace tree to stdout. The format of the CSV stream is as follows:

  trace id, trace path, threadname, duration, isolated duration
 
The column trace path contains chained ids that represent the trace path. The IDs will be separated by dots. Example: The Id $Session.step1.step2 will be generated for a trace step with id step2 that is a child of step1 and is executed in the context of trace session $Session.

Author:
Gunther Popp

Constructor Summary
CSVTraceFormatter()
          Default constructor.
 
Method Summary
protected  String formatSingleStep(ITraceStep step, int level)
          CALL-BACK: Generate formatted output for a single trace step.
protected  void writeFooter(ITraceSession session, Writer toWriter)
          CALL-BACK: Write the footer of the trace output.
protected  void writeHeader(ITraceSession session, Writer toWriter)
          CALL-BACK: Write the header of the trace output.
 
Methods inherited from class org.e2etrace.formatter.AbstractTraceFormatter
format, getNewLine, writeSteps
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVTraceFormatter

public CSVTraceFormatter()
Default constructor.

Method Detail

formatSingleStep

protected String formatSingleStep(ITraceStep step,
                                  int level)
CALL-BACK: Generate formatted output for a single trace step.

Specified by:
formatSingleStep in class AbstractTraceFormatter
Parameters:
step - trace step
level - current call level (starting with 0)
Returns:
formatted output

writeFooter

protected void writeFooter(ITraceSession session,
                           Writer toWriter)
CALL-BACK: Write the footer of the trace output.

Specified by:
writeFooter in class AbstractTraceFormatter
Parameters:
session - trace session
toWriter - output writer

writeHeader

protected void writeHeader(ITraceSession session,
                           Writer toWriter)
                    throws IOException
CALL-BACK: Write the header of the trace output.

Specified by:
writeHeader in class AbstractTraceFormatter
Parameters:
session - trace session
toWriter - output writer
Throws:
IOException


Copyright © 2013 Gunther Popp. All Rights Reserved.