|
Copyright @ 2001 SAP. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Interface for all monitoring objects. A monitoring object provides mechanism for passing information concerning requests and components. Internally this information is used to provide (accumulated) information about threads, requests and components.
General concept:
- Request: main monitoring unit
- Task: a request could be processed in several threads which run
asynchronously; the work done by one thread is called a task;
(in the current version there is a 1:1 relation between
request and task -> one request is processed by one task)
- Component: a component is the smallest unit of monitoring;
a task is made up of several components which could be nested;
in order to reduce monitoring overhead a component should
need in average a reasonable amount of execution time
(several ms)
- Action: if it should be indicated which part of a component is currently
processed an 'action' call should be done; neither monitoring
data is stored nor timestamp information is collected,
the 'action' is just shown in the thread overview
Some examples to describe the usage of the methods described below
(assume: the class 'TaskMonitor' implements this interface):
1. Nested Components Example
...
myMonitor = TaskMonitor.getRequestMonitor("MyUser", "MyRequest");
myMonitor.startComponent("Component A");
...
myMonitor.startComponent("Component B");
...
myMonitor.startComponent("Component C");
...
myMonitor.endComponent("Component C");
...
myMonitor.endComponent("Component B");
...
myMonitor.startComponent("Component D");
...
myMonitor.endComponent("Component D");
...
myMonitor.endComponent("Component A");
int outputDataLen = response.calcDataLen(); // data length could be
myMonitor.endRequest("MyRequest", outputDataLen); // provided optionally
-------------------------------------------------------------------
2. Usage of components which provides no monitoring information
...
myMonitor = TaskMonitor.getRequestMonitor("MyUser", "MyRequest");
myMonitor.startComponent("Component A");
...
myMonitor.startComponent("ForeignComponent 1");
ForeignComponent_A(...); // sync call
int outputDatalen = response.calcDataLen(); // data length could be
// provided optionally
myMonitor.endComponent("ForeignComponent 1", outputDataLen);
...
outputDataLen = response.calcDataLen(); // data length could be
myMonitor.endRequest(outputDataLen); // provided optionally
--------------------------------------------------------------------
3. Usage of requests in different layers
Here it is shown how monitoring could be implemented in different layers (e.g. a I2EE server and a Bean)
...
i2eeMonitor = TaskMonitor.getRequestMonitor("MyUser", "I2EERequest 1");
i2eeMonitor.startComponent("I2EEComponent A");
...
i2eeMonitor.startComponent("I2EE Bean 1");
- - - - - - - - - - - - - - - - - - - -
...
beanMonitor = TaskMonitor.getRequestMonitor("MyUser", "BeanRequest 1");
// because there is already a monitor object (i2eeMonitor)
// this object is returned -> beanMonitor == i2eeMonitor
// if this would run in an i2ee which is not instrumented
// a new object would have been returned;
beanMonitor.startComponent("beanComponent 1");
...
beanMonitor.endComponent("beanComponent 1");
beanMonitor.endRequest("BeanRequest 1");
// internally this call is skipped because the request's name
// is "I2EERequest 1"
// be aware that instrumenting the bean is not dependant on the
// surrounding layer (exception: there must be different names for
// requests and components -> define namespaces); additionally like
// all the other examples it does not matter whether monitoring is
// on or off; if monitoring is off you get a dummy object which supports
// IMonitor also
...
- - - - - - - - - - - - - - - - - -
i2eeMonitor.endComponent("I2EE Bean 1");
// because of this coding even without instrumenting the
// bean you will collect monitoring information
// about the bean
...
i2eeMonitor.endComponent("I2EEComponent A");
outputDataLen = response.calcDataLen();
myMonitor.endRequest("I2EERequest 1", outputDataLen);
--------------------------------------------------------------------
| Method Summary | |
void |
compAction(int compLevel,
java.lang.String compName,
java.lang.String action)
Indicates a specific action of a component. The method is executed only if compLevel is lower or equal the current component monitoring level. |
void |
compAction(java.lang.String compName,
java.lang.String action)
Indicates a specific action of a component. Component monitor level = 0 (ConfMonitor.COMPLEVELBASIC) |
void |
endComponent(int compLevel,
java.lang.String compName)
Indicates the end of a component. The method is executed only if compLevel is lower or equal the current component monitoring level. |
void |
endComponent(int compLevel,
java.lang.String compName,
int dataLength)
same functionality than endComponent(String); additionally the amount of data which is returned by the component is provided. The method is executed only if compLevel is lower or equal the current component monitoring level. |
void |
endComponent(int compLevel,
java.lang.String compName,
int dataLength,
java.lang.Object compProps)
same functionality than endComponent(String, int); additionally component specific properties are provided. the component specific properties could only be handled if the parameter jarm/comp/properties/switch=on (default) and if there is there is an implementation of ICompProperties for this component provided The method is executed only if compLevel is lower or equal the current component monitoring level. |
void |
endComponent(int compLevel,
java.lang.String compName,
java.lang.Object compProps)
same functionality than endComponent(String); additionally component specific properties are provided. the component specific properties could only be handled if the parameter jarm/comp/properties/switch=on (default) and if there is there is an implementation of ICompProperties for this component provided. The method is executed only if compLevel is lower or equal the current component monitoring level. |
void |
endComponent(java.lang.String compName)
Indicates the end of a component. Component monitor level = 0 (ConfMonitor.COMPLEVELBASIC) |
void |
endComponent(java.lang.String compName,
int dataLength)
same functionality than endComponent(String); additionally the amount of data which is returned by the component is provided. Component monitor level = 0 (ConfMonitor.COMPLEVELBASIC) |
void |
endComponent(java.lang.String compName,
int dataLength,
java.lang.Object compProps)
same functionality than endComponent(String, int); additionally component specific properties are provided. the component specific properties could only be handled if the parameter jarm/comp/properties/switch=on (default) and if there is there is an implementation of ICompProperties for this component provided. Component monitor level = 0 (ConfMonitor.COMPLEVELBASIC) |
void |
endComponent(java.lang.String compName,
java.lang.Object compProps)
same functionality than endComponent(String); additionally component specific properties are provided. the component specific properties could only be handled if the parameter jarm/comp/properties/switch=on (default) and if there is there is an implementation of ICompProperties for this component provided. Component monitor level = 0 (ConfMonitor.COMPLEVELBASIC) |
RequestOverview |
endRequest(int retOverview,
java.lang.String reqName)
same functionality than endRequest(reqName); additionally the collected data for the request is returned if retOverview = true |
RequestOverview |
endRequest(int retOverview,
java.lang.String reqName,
int dataLength)
same functionality than endRequest(String reqName, int dataLength); additionally the collected data for the request is returned |
void |
endRequest(java.lang.String reqName)
if the name of the current request is identical to reqName the request is closed; otherwise the call is skipped. |
void |
endRequest(java.lang.String reqName,
int dataLength)
same functionality than endRequest(String reqName); additionally the amount of data which is returned by the request is provided |
int |
getComponentLevel()
The component level for the request is returned. |
boolean |
getMonitorSwitch()
Indicates whether monitoring is switched on or off for this request |
java.lang.String |
getReqName()
Delivers the name of the request |
long |
getReqTS()
Delivers the start timestamp of the request |
boolean |
getTraceSwitch()
Indicates whether tracing is switched on or off for this request |
java.lang.String |
getUser()
Delivers the user name of the request |
boolean |
isJarmActiveForRequest()
Indicates whether monitoring or tracing is switched on or off for this request |
void |
setComponentLevel(int compLevel)
The component monitor level for the request is set. The level could only be set right at the beginning of a request before the first component is started. |
void |
setDescription(java.lang.String descr)
Set description for request (text string); if the description is already set for the request it could not be overwritten |
void |
setUser(java.lang.String userName)
If the user name was not known when the request was started it could be set by this call afterwards; if a user name is already bound to the request the call is skipped |
void |
startComponent(int compLevel,
java.lang.String compName)
Indicates the start of a component. The method is executed only if compLevel is lower or equal the current component monitoring level. |
void |
startComponent(java.lang.String compName)
Indicates the start of a component. Component monitor level = 0 (ConfMonitor.COMPLEVELBASIC) |
| Method Detail |
public void endRequest(java.lang.String reqName)
reqName - logical name of the request
public void endRequest(java.lang.String reqName,
int dataLength)
reqName - logical name of the requestdataLength - amount of data in bytes which is returned from
requestendRequest(String)
public RequestOverview endRequest(int retOverview,
java.lang.String reqName)
retOverview - ConfMonitor.REQOVERVIEWALL
<-> return all collected monitoring data;
ConfMonitor.REQOVERVIEWNONE
<-> 'null' is returned
ConfMonitor.REQOVERVIEWHEADER
<-> only heeader information is returned, but
no data about tasks or single componentsreqName - logical name of the requestendRequest(String)
public RequestOverview endRequest(int retOverview,
java.lang.String reqName,
int dataLength)
retOverview - ConfMonitor.REQOVERVIEWALL
<-> return all collected monitoring data;
ConfMonitor.REQOVERVIEWNONE
<-> 'null' is returned
ConfMonitor.REQOVERVIEWHEADER
<-> only heeader information is returned, but
no data about tasks or single componentsreqName - logical name of the requestdataLength - amount of data in bytes which is returned from
requestendRequest(String, int)public void startComponent(java.lang.String compName)
compName - logical name of the current component.
public void startComponent(int compLevel,
java.lang.String compName)
compLevel - component monitor level; 0 (ConfMonitor.COMPLEVELBASIC),
1 (ConfMonitor.COMPLEVELMEDIUM),
2 (ConfMonitor.COMPLEVELDETAIL.compName - logical name of the current component.public void endComponent(java.lang.String compName)
compName - logical name of the current component.
public void endComponent(java.lang.String compName,
int dataLength)
compName - logical name of the current component.dataLength - amount of data in bytes which is returned by the
componentendComponent(String)
public void endComponent(java.lang.String compName,
java.lang.Object compProps)
compName - logical name of the current component.compProps - component specific properties
public void endComponent(java.lang.String compName,
int dataLength,
java.lang.Object compProps)
compName - logical name of the current component.dataLength - amount of data in bytes which is returned by the
componentcompProps - component specific properties
public void endComponent(int compLevel,
java.lang.String compName)
compLevel - component monitor level; 0 (ConfMonitor.COMPLEVELBASIC),
1 (ConfMonitor.COMPLEVELMEDIUM),
2 (ConfMonitor.COMPLEVELDETAIL.compName - logical name of the current component.
public void endComponent(int compLevel,
java.lang.String compName,
int dataLength)
compLevel - component monitor level; 0 (ConfMonitor.COMPLEVELBASIC),
1 (ConfMonitor.COMPLEVELMEDIUM),
2 (ConfMonitor.COMPLEVELDETAIL.compName - logical name of the current component.dataLength - amount of data in bytes which is returned by the
componentendComponent(String)
public void endComponent(int compLevel,
java.lang.String compName,
java.lang.Object compProps)
compLevel - component monitor level; 0 (ConfMonitor.COMPLEVELBASIC),
1 (ConfMonitor.COMPLEVELMEDIUM),
2 (ConfMonitor.COMPLEVELDETAIL.compName - logical name of the current component.compProps - component specific properties
public void endComponent(int compLevel,
java.lang.String compName,
int dataLength,
java.lang.Object compProps)
compLevel - component monitor level; 0 (ConfMonitor.COMPLEVELBASIC),
1 (ConfMonitor.COMPLEVELMEDIUM),
2 (ConfMonitor.COMPLEVELDETAIL.compName - logical name of the current component.dataLength - amount of data in bytes which is returned by the
componentcompProps - component specific properties
public void compAction(java.lang.String compName,
java.lang.String action)
compName - logical name of the current component.action - action currently done by the component.
public void compAction(int compLevel,
java.lang.String compName,
java.lang.String action)
compLevel - component monitor level; 0 (ConfMonitor.COMPLEVELBASIC),
1 (ConfMonitor.COMPLEVELMEDIUM),
2 (ConfMonitor.COMPLEVELDETAIL.compName - logical name of the current component.action - action currently done by the component.public boolean isJarmActiveForRequest()
public boolean getMonitorSwitch()
public boolean getTraceSwitch()
public int getComponentLevel()
public java.lang.String getUser()
public java.lang.String getReqName()
public long getReqTS()
public void setUser(java.lang.String userName)
userName - name of user who executes the requestpublic void setDescription(java.lang.String descr)
descr - descriptionpublic void setComponentLevel(int compLevel)
compLevel; - 0 (ConfMonitor.COMPLEVELBASIC),
1 (ConfMonitor.COMPLEVELMEDIUM),
2 (ConfMonitor.COMPLEVELDETAIL.
|
Copyright @ 2001 SAP. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||