|
|||||||||||
| 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");
}
}
| 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. |
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 |
| 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 point
protected void instanceMethodFinished(java.lang.Object traceTag,
java.lang.String text)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||