A performance monitor that computes the average time for a process. Defines a monitor for measuring the time for the HTTP responses, session duration, and so on.
For example, if N and T are the total number of responses and the total response time respectively, the values under the last measurement node are calculated as follows:
number of requests = Ni - Ni-1
average time = Ti - Ti-1 / Ni - Ni-1 or 0 if Ni = Ni-1
There are two ways of instrumenting the duration monitor: in the monitor-configuration.xml and in the source code:
· In the monitor-configuration.xml this monitor is specified in the following way:
<duration-monitor name="Commit Duration" configuration-group="ConfigMgr.CommitDuration"> <monitored-resource name="ConfigurationManager" type="MANAGER"/> <duration-attribute-mapping> <total-number-attribute> <observed-resource-attribute name="AccNrOfCommits"/> </total-number-attribute> <total-time-attribute> <observed-resource-attribute name="AccCommitTime"/> </total-time-attribute> </duration-attribute-mapping> </duration-monitor> |
· The method returning the total number of tries is:
public long getAccNrOfCommits(); |
In this example, the accumulated number of commit-requests since the server startup is returned.
· The method returning the total time is:
public long getAccCommitTime(); |
In this example, the accumulated time (in milliseconds) of processing all commit-requests since the server startup is returned.
· In the monitor-configuration.xml this monitor is specified in the following way:
<duration-monitor name="Commit Duration" configuration-group="ConfigMgr.CommitDuration"> <monitored-resource name="ConfigurationManager" type="MANAGER"/> <duration-attribute-mapping> <duration-attribute> <observed-resource-attribute name="DurationValue "/> </duration-attribute> </duration-attribute-mapping> </duration-monitor> |
· The method returning the necessary data is:
public com.sap.jmx.monitoring.api.DurationValue getDurationValue(); |