wt.util
Class TraceTimingReportHelper

java.lang.Object
  extended bywt.util.TraceTimingReportHelper

public class TraceTimingReportHelper
extends Object

This class provides static methods for reporting based on TraceTiming entry lists.

Supported API: false

Extendable: false


Nested Class Summary
(package private) static class TraceTimingReportHelper.UsageInfo
           
 
Field Summary
static String[] CATEGORIES
           
static boolean CATEGORIZE_PACKAGES
           
private static String CLASSNAME
           
private static boolean DEBUG
           
static String DEFAULT_CATEGORY
           
private static DebugWriter LOG
           
static String NEW_LINE
           
private static String RESOURCE
           
 
Constructor Summary
TraceTimingReportHelper()
           
 
Method Summary
private static StringBuffer appendFill(StringBuffer a_buffer, char a_fill, int a_count)
           
static Map buildTimingMap(List a_entryList, int a_entryIndex)
          This method builds a map of begin TraceTimingEntries and the elapsed time spent in each entry.
static Map buildUsageMap(Map a_timingMap)
          This method builds a usage map of the accumulated time spent in a given operation.
private static int findNamedOrEndEntry(List a_entryList, int a_index, Set a_nameSet, String a_endNameKey)
           
private static TraceTimingEntry getBeginEntry(List a_entryList, int a_index)
           
private static String getCategory(String a_nameKey)
           
private static TraceTimingEntry getEndEntry(List a_entryList, int a_index)
           
private static TraceTimingEntry getEntry(List a_entryList, int a_index)
           
private static int incrementMap(Map a_map, Object a_key)
           
private static int processCountTiming(List a_entryList, int a_index, Map a_countMap, Map a_timingMap)
           
private static int processNameTiming(List a_entryList, int a_index, Set a_nameSet, String a_otherNameKey, Map a_timingMap)
           
static String reportCallTrace(List a_entryList, boolean a_includeInfo)
          This method returns report of the call trace with timings.
static String reportCallTrace(List a_entryList, boolean a_includeInfo, int a_entryIndex)
          This method returns report of the call trace with timings.
static void reportCallTrace(List a_entryList, StringBuffer a_buffer, boolean a_includeInfo, int a_entryIndex)
          This method appends to the StringBuffer a report of the call trace with timings.
static String reportTraceUsage(Map a_usageMap)
          This method returns a report of each unique trace name with the count and average trace timings.
static void reportTraceUsage(Map a_usageMap, StringBuffer a_buffer)
          This method appends to the StringBuffer a report of each unique trace name with the count and average trace timings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

DEBUG

private static final boolean DEBUG

LOG

private static final DebugWriter LOG

NEW_LINE

public static final String NEW_LINE
See Also:
Constant Field Values

CATEGORIES

public static final String[] CATEGORIES

CATEGORIZE_PACKAGES

public static final boolean CATEGORIZE_PACKAGES

DEFAULT_CATEGORY

public static final String DEFAULT_CATEGORY
See Also:
Constant Field Values
Constructor Detail

TraceTimingReportHelper

public TraceTimingReportHelper()
Method Detail

reportCallTrace

public static String reportCallTrace(List a_entryList,
                                     boolean a_includeInfo)
This method returns report of the call trace with timings.

Supported API: false

Parameters:
a_entryList - List of TraceTimingEntries.
a_includeInfo - Include the associated entry information in the report.
Returns:
String

reportCallTrace

public static void reportCallTrace(List a_entryList,
                                   StringBuffer a_buffer,
                                   boolean a_includeInfo,
                                   int a_entryIndex)
This method appends to the StringBuffer a report of the call trace with timings.

Supported API: false

Parameters:
a_entryList - List of TraceTimingEntries.
a_buffer - Buffer to append report to.
a_includeInfo - Include the associated entry information in the report.
a_entryIndex - Entry index to begin report with.

reportTraceUsage

public static String reportTraceUsage(Map a_usageMap)
This method returns a report of each unique trace name with the count and average trace timings.

Supported API: false

Parameters:
a_usageMap - Map of TraceTimingEntry names and UsageInfos.
Returns:
String

reportTraceUsage

public static void reportTraceUsage(Map a_usageMap,
                                    StringBuffer a_buffer)
This method appends to the StringBuffer a report of each unique trace name with the count and average trace timings. report of the call trace with timings.

Supported API: false

Parameters:
a_usageMap - Map of TraceTimingEntry names and UsageInfos.
a_buffer - Buffer to append report to.

buildTimingMap

public static Map buildTimingMap(List a_entryList,
                                 int a_entryIndex)
This method builds a map of begin TraceTimingEntries and the elapsed time spent in each entry. The key is the TraceTimingEntry getCountKey() which includes the unique trace call path.

Supported API: false

Parameters:
a_entryList - List of TraceTimingEntries.
a_entryIndex - Entry index to begin report with.
Returns:
Map

buildUsageMap

public static Map buildUsageMap(Map a_timingMap)
This method builds a usage map of the accumulated time spent in a given operation. The key is the TraceTimingEntry getNametKey() and the value is a TraceTimingReportHelper.UsageInfo instance.

Supported API: false

Parameters:
a_timingMap - Timing map from a list of TraceEntries.
Returns:
Map

reportCallTrace

public static String reportCallTrace(List a_entryList,
                                     boolean a_includeInfo,
                                     int a_entryIndex)
This method returns report of the call trace with timings.

Supported API: false

Parameters:
a_entryList - List of TraceTimingEntries.
a_includeInfo - Include the associated entry information in the report.
a_entryIndex - Entry index to begin report with.
Returns:
String

processNameTiming

private static int processNameTiming(List a_entryList,
                                     int a_index,
                                     Set a_nameSet,
                                     String a_otherNameKey,
                                     Map a_timingMap)

processCountTiming

private static int processCountTiming(List a_entryList,
                                      int a_index,
                                      Map a_countMap,
                                      Map a_timingMap)

incrementMap

private static int incrementMap(Map a_map,
                                Object a_key)

findNamedOrEndEntry

private static int findNamedOrEndEntry(List a_entryList,
                                       int a_index,
                                       Set a_nameSet,
                                       String a_endNameKey)

getEntry

private static TraceTimingEntry getEntry(List a_entryList,
                                         int a_index)

getBeginEntry

private static TraceTimingEntry getBeginEntry(List a_entryList,
                                              int a_index)

getEndEntry

private static TraceTimingEntry getEndEntry(List a_entryList,
                                            int a_index)

getCategory

private static String getCategory(String a_nameKey)

appendFill

private static StringBuffer appendFill(StringBuffer a_buffer,
                                       char a_fill,
                                       int a_count)