Show TOC Start of Content Area

Procedure documentation Creating the Transaction Duration Duration Monitor  Locate the document in its SAP Library structure

Procedure

The duration monitors use two methods to calculate their values.

...

       1.      BankMBean:

public long getTotalTransactionNumber();

and

public long getTotalTransactionTime();

 

       2.      Bank:

public long getTotalTransactionNumber() {

   return transaction.getTotalTransactionNumber();

}

and

public long getTotalTransactionTime() {

   return transaction.getTotaltransactionTime();

}

 

This information is coming from class Transaction. The total transaction number is the same value as in the frequency and quality-rate monitors. The total transaction time is a variable of class Transaction (“private long totalTransactionTime“). In fact, this is the time the counter thread is “sleeping” in the gotoCounter(Client client) method and this is the value returned from this method.

 

       3.      Modify the monitor-configuration.xml:

                            a.      Define the monitor-semantics:

<duration-configuration-group name="TransactionDuration">

    <description ID="Transaction duration">Average duration of client transaction.</description>

    <data-collection react-on-failure="IGNORE" >

        <polled-by-monitor period="1" unit="MINUTE"/>

    </data-collection>

    <thresholds green-to-yellow="500" yellow-to-red="6000" red-to-yellow="6000" yellow-to-green="500"/>

    <history averaging-mode="TIME_WEIGHTED"/>

</duration-configuration-group>

 

                            b.      Define the monitor-tree:

<duration-monitor name="Transaction duration" configuration-group="TransactionDuration">

    <monitored-resource name="BankMBean" type="APPLICATION"/>

    <duration-attribute-mapping>

         <total-number-attribute>

    <observed-resource-attribute name="TotalTransactionNumber"/>

        </total-number-attribute>

        <total-time-attribute>

       <observed-resource-attribute name="TotalTransactionTime"/>

      </total-time-attribute>

   </duration-attribute-mapping>

</duration-monitor>

 

The monitoring framework expects two methods for the duration monitors, both returning long values. That is why the return values of the getTotalTransactionTime() and getTotalTransactionNumber() methods are long. These methods are declared in the BankMBean interface and are implemented in the class Bank. In the monitor-semantics part of the monitor-configuration.xml a duration-configuration-group is declared with the name TransactionDuration, which is used for creating the node in the monitor tree (the monitor-tree part in the XML). The ID in the Transaction duration description is the name of the monitor shown in the tree.

Result

The Transaction Duration monitor appears in the monitoring tree under Applications Bank Information General Information.

 

Next, see Dynamically Installed Monitors.

 

End of Content Area