Remote Systems
v6.4.1

com.ibm.etools.systems.logging.performance
Class PerformanceLogger

java.lang.Object
  extended bycom.ibm.etools.systems.logging.performance.PerformanceLogger

public class PerformanceLogger
extends Object

A performance measurement class for benchmarking. This performance framework provides stopwatch functions for calculating elapsed time for an operation. Usuage example Method_A { String key = PerformanceLogger.register("RSE","WDSC","5120"); PerformanceLogger.start(key, "OP1"); //CallerID is OP1 Method_B(); PerformanceLogger.stop(key); } Method_B { PerformanceLogger.start("RSE"); //"RSE" component, CalleID="class.method" // Do something PerformanceLogger.stop("RSE"); } Method_C { PerformanceLogger.start(); //Use the default component for recording // Do something PerformanceLogger.stop(); }


Field Summary
static boolean _ENABLE_PERFORMANCE_LOGGING_IBM_INTERNAL_
           
static String copyright
           
static int OPTION_GET_ALL
           
static int OPTION_GET_FEATURE
           
static int OPTION_GET_VERSION
           
 
Method Summary
static void deRegister()
          public static void deRegister(): De-register the default component
static void deRegister(String key)
          public static void deRegister(String key): De-register a component
static void enablePerformanceLogging(boolean enable)
          public static void enablePerformanceLogging(boolean enable) : enable performance logging
static String getCurrentProductInfo(int req, String comp_id)
          public String geCurrentProductInfo(int req, String comp_id) : retrieve the product information.
static String getXMLFileName(String comp_id)
          public String getXMLFileName(String comp_id) : get the XML file pathname
static boolean isPerformanceLoggingEnabled()
          public static boolean isPerformanceLoggingEnabled() : check if logging enabled
static void listSystemProfile()
          public static void listSystemProfile(): retrieve the system information.
static void main(String[] args)
          public static void main() : This main is used for testing this PerformanceLogger functions.
static String register(String comp_id)
           
static String register(String feature, String version)
           
static String register(String comp_id, String feature, String version)
          public static String register(String comp_id, String feature, String version) : Registering a component
static long start()
          public static long start(): start timer using default component The Task values will be recorded in the default component XML file
static long start(String comp_id)
          public static long start(String comp_id): start timer for component comp_id using default TaskID
static long start(String comp_id, String call_id)
          public long start(String comp_id, String call_id): start the timer for registered component comp_id
static long stop()
          public static long stop(): stop timer for default component The Task values will be recorded in the default component XML file
static long stop(String comp_id)
          public long stop(String comp_id): Stopping the timer for component comp_id
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

_ENABLE_PERFORMANCE_LOGGING_IBM_INTERNAL_

public static final boolean _ENABLE_PERFORMANCE_LOGGING_IBM_INTERNAL_
See Also:
Constant Field Values

OPTION_GET_ALL

public static final int OPTION_GET_ALL
See Also:
Constant Field Values

OPTION_GET_FEATURE

public static final int OPTION_GET_FEATURE
See Also:
Constant Field Values

OPTION_GET_VERSION

public static final int OPTION_GET_VERSION
See Also:
Constant Field Values
Method Detail

enablePerformanceLogging

public static void enablePerformanceLogging(boolean enable)
public static void enablePerformanceLogging(boolean enable) : enable performance logging

Parameters:
enable - : true or false
Returns:
The flag ENABLE_PERFORMANCE_LOGGING is enable(true or false)

isPerformanceLoggingEnabled

public static boolean isPerformanceLoggingEnabled()
public static boolean isPerformanceLoggingEnabled() : check if logging enabled

Returns:
boolean ENABLE_PERFORMANCE_LOGGING

register

public static String register(String comp_id)

register

public static String register(String feature,
                              String version)

register

public static String register(String comp_id,
                              String feature,
                              String version)
public static String register(String comp_id, String feature, String version) : Registering a component

Returns:
- comp_id as the registered key - An XML file is created by concatenating comp_id, feature and version with time stamp appended

deRegister

public static void deRegister()
public static void deRegister(): De-register the default component

Returns:
Default component "_PERFORMANCELOGGER_" removed start() will be disabled

deRegister

public static void deRegister(String key)
public static void deRegister(String key): De-register a component

Returns:
component identified by key removed start(comp_id) will be disabled

start

public static long start()
public static long start(): start timer using default component The Task values will be recorded in the default component XML file

Returns:
- started time milliseconds

start

public static long start(String comp_id)
public static long start(String comp_id): start timer for component comp_id using default TaskID

Returns:
- started time in milliseconds.

start

public static long start(String comp_id,
                         String call_id)
public long start(String comp_id, String call_id): start the timer for registered component comp_id

Returns:
- started time in milliseconds.

stop

public static long stop()
public static long stop(): stop timer for default component The Task values will be recorded in the default component XML file

Returns:
- started time milliseconds

stop

public static long stop(String comp_id)
public long stop(String comp_id): Stopping the timer for component comp_id

Returns:
- stopped time in milliseconds.

getCurrentProductInfo

public static String getCurrentProductInfo(int req,
                                           String comp_id)
public String geCurrentProductInfo(int req, String comp_id) : retrieve the product information.

Parameters:
req - : OPTION_GET_FEATURE/OPTION_GET_VERSION comp_id : the component id
Returns:
"OPTION_GET_FEATURE":product feature as specified in register() "OPTION_GET_VERSION": product version as specified in register() no match: null

getXMLFileName

public static String getXMLFileName(String comp_id)
public String getXMLFileName(String comp_id) : get the XML file pathname

Returns:
The XML file fullpath name.

listSystemProfile

public static void listSystemProfile()
public static void listSystemProfile(): retrieve the system information.

Returns:
These values will be retrieved and printed in stdout: java.version java.vm.version java.class.version java.class.path java.library.path os.name os.version

main

public static void main(String[] args)
public static void main() : This main is used for testing this PerformanceLogger functions. The objective is to check the XML output format for nested start() calls.


Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.