|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sap.ip.me.api.services.PerformanceLog
Class for logging running time and memory usage between specified measurement points.
The PerformanceLog has to be enabled in MobileEngine.config with Property Key
'MobileEngine.Trace.PerformanceLog.Enabled = true'.
Example for usage:
public void methodToBeMeasured() {
Important: methodFinished() must be called at the end of any method that shall be traced,
even if an Exception has been risen. Therefore, it must be called from a finally clause.
Object perfLogTag = PerformanceLog.methodStarted(this);
try{
//put the code to be measured in here
}
catch(Exception e ){
} finally {
PerformanceLog.methodFinished(perfLogTag, "additional description");
}
}
The following Parameters can be configured for the PerformanceLog:
MobileEngine.Trace.PerformanceLog.Enabled = (default is false)
MobileEngine.Trace.PerformanceLog.SingleFile = (default is true)
MobileEngine.Trace.PerformanceLog.LineCount = (default is 20000 if SingleFile is set to false)
MobileEngine.Trace.PerformanceLog.LogPath = (default is MI log dir)
Field Summary | |
protected static java.lang.String[] |
BLANK
|
protected static int |
BLANK_MAX
|
protected static java.lang.Object |
DEFAULT_MASTER
|
protected static java.lang.String[] |
INDENT
|
protected static int |
INDENT_MAX
|
protected static java.lang.Runtime |
RUNTIME
|
protected static boolean |
satActive
|
Constructor Summary | |
protected |
PerformanceLog()
|
Method Summary | |
protected static PerformanceLog |
getInstance()
|
protected void |
instanceMethodFinished(java.lang.Object traceTag,
java.lang.String text)
|
protected void |
instanceMethodFinished(java.lang.String text)
|
protected void |
instanceMethodStarted()
|
protected java.lang.Object |
instanceMethodStarted(java.lang.Object self)
|
static boolean |
isOn()
Returns the state of PerformanceLog. |
static void |
methodFinished(java.lang.Object traceTag,
java.lang.String text)
Logs the time and memory usage between the last call of PerformanceLog.methodStarted() and the call of this method. |
static void |
methodFinished(java.lang.String text)
Logs the time and memory usage between the last call of PerformanceLog.methodStarted() and the call of this method. |
static void |
methodStarted()
Method has to be called at start of any method that shall be traced. |
static java.lang.Object |
methodStarted(java.lang.Object self)
Method has to be called at start of any method that shall be traced. |
protected static void |
padLong(long val,
int len,
java.io.PrintWriter out)
|
static void |
print()
Deprecated. Only included for compatibility reasons. No external call of this is needed. |
static void |
reset()
Deprecated. Clears the trace stack. No external call of this is needed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String[] INDENT
protected static final java.lang.String[] BLANK
protected static final int INDENT_MAX
protected static final int BLANK_MAX
protected static final java.lang.Object DEFAULT_MASTER
protected static final java.lang.Runtime RUNTIME
protected static boolean satActive
Constructor Detail |
protected PerformanceLog()
Method Detail |
protected static final PerformanceLog getInstance()
public static final boolean isOn()
public static final void reset()
public static final void print()
public static final void methodStarted()
protected void instanceMethodStarted()
public static final java.lang.Object methodStarted(java.lang.Object self)
self
- Reference on the calling Object. This sets the new Master for the Log.
protected java.lang.Object instanceMethodStarted(java.lang.Object self)
public static void methodFinished(java.lang.String text)
text
- Additional description for the measurement pointprotected void instanceMethodFinished(java.lang.String text)
public static void methodFinished(java.lang.Object traceTag, java.lang.String text)
traceTag
- Tag Object generated with methodStarted(this)text
- Additional description for the measurement pointprotected void instanceMethodFinished(java.lang.Object traceTag, java.lang.String text)
protected static final void padLong(long val, int len, java.io.PrintWriter out)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |