Recent Blog Entries

Friday, 17 August 2012

AIA/SOA Trips & Tricks (3) : How to Save BPEL 10g Statistics Programmatically in a File

In Oracle BPEL Process Manager, statistics about the average execution times of BPEL processes can be displayed on the BPEL Console:

image

It is very important to monitor these values to be able to react on abnormal high execution times – especially for sync processes – to prevent from JTA transaction timeouts, for example.

While this is possible with EM Grid Control and SOA Management Pack, there is no out of the box solution without EM GC  for saving these statistics periodically to a file.

For this purpose, I have written two Java classes – one for retrieving the statistics via the BPEL API and one for resetting the statistics values.

The first makes use of of the following API calls

Statistics[] asyncStats = domain.getAsyncStatistics();
System.out.println("===> Async BPEL Domain Statistics:");
for (int i=0;i<asyncStats.length;i++)
    System.out.println(asyncStats[i]);

Statistics[] syncStats = domain.getSyncStatistics();
System.out.println("===> Sync BPEL Domain Statistics:");
for (int i=0;i<syncStats.length;i++)               
    System.out.println(syncStats[i]);

Statistics[] requestStats = domain.getRequestStatistics();
System.out.println("===> BPEL Engine Requests Statistics:");
for (int i=0;i<requestStats.length;i++)
    System.out.println(requestStats[i]);

The JDeveloper project with both classes can be downloaded from here.

To adapt it to your environment, you need to change the connection URL and credentials in file classes/context.properties. Also you need to have the OC4J libraries listed in getBPELStats.sh in a local directory (copy these from the server).

Sample output:  (format is:  minimum < “Process Name”  ~ average  < maximum time is milliseconds)

GetBPELStats for SOA10g
Date: 17.08.2012 11:41:41:336
===> Successfully connected to domain default
===> Async BPEL Domain Statistics:
3158 < OrderEnqueue 1.0 ~ 3158.0 < 3158 based on 1 stats
===> Sync BPEL Domain Statistics:
781 < SyncCustomerPartyListBRMCommsProvABCSImpl 1.0 ~ 972.9 < 1261 based on 10 stats
18468 < CommsProcessFulfillmentOrderBillingAccountListEBF 1.0 ~ 18995.5 < 19315 based on 10 stats
14181 < CommsProcessBillingAccountListEBF 1.0 ~ 14589.9 < 14881 based on 10 stats
1461 < QueryCustomerPartyListSiebelProvABCSImplV2 1.0 ~ 1908.2 < 2605 based on 10 stats
1346 < ProcessFulfillmentOrderBillingResponseOSMCFSCommsJMSProducer 1.0 ~ 1504.3 < 1792 based on 10 stats
7255 < ProcessSalesOrderFulfillmentSiebelCommsReqABCSImpl 1.0 ~ 7543.5 < 7704 based on 10 stats
5 < AIASessionPoolManager 1.0 ~ 716.3 < 2162 based on 20 stats
18692 < ProcessFulfillmentOrderBillingBRMCommsProvABCSImpl 1.0 ~ 21442.1 < 22780 based on 10 stats
108791 < TestOrderOrchestrationEBF 1.0 ~ 109057.7 < 109601 based on 10 stats
17035 < UpdateSalesOrderSiebelCommsProvABCSImpl 1.0 ~ 18881.2 < 20064 based on 10 stats
3403 < ProcessFulfillmentOrderBillingBRMCommsAddSubProcess 1.0 ~ 3973.8 < 4550 based on 10 stats
1816 < ProcessSalesOrderFulfillmentOSMCFSCommsJMSProducer 1.0 ~ 2263.8 < 2448 based on 10 stats
2426 < ProcessFOBillingAccountListRespOSMCFSCommsJMSProducer 1.0 ~ 2784.2 < 3002 based on 10 stats
===> BPEL Engine Requests Statistics:
0 < eng-composite-request.eng-single-request.handle-workitem.do-perform.actual-perform.InvokePCM_OP_CUST_COMMIT_CUSTOMER.sensor-send-activity-data ~ 0.0 < 0 based on 20 stats
8 < eng-composite-request.eng-single-request.handle-workitem.do-perform.actual-perform.Invoke_UpdateSO.invoke-service.invoke.actual-invoke.wsif-invoke.wsif-remote-call.prepare-call.populate-message.deep-copy ~ 14.2 < 20 based on 10 stats
0 < eng-composite-request.glue-requests-store.cube-instance-save-datastore.ci-store.at-store.at-db-insert.to-byte-array ~ 0.05 < 2 based on 71 stats
0 < eng-composite-request.eng-single-request.handle-workitem.do-perform.actual-perform.TwoPhaseMode_to_Three.sensor-send-variable-data ~ 0.0 < 0 based on 10 stats
1 < eng-composite-request.eng-single-request.load-instance-for-workitem.load-instance.actual-instance-load.cube-instance-load-datastore.ci-load.ci-load-instance ~ 4.2 < 71 based on 40 stats
4 < eng-composite-request.eng-single-request.handle-workitem.do-perform.actual-perform.ds-subscribe ~ 12.17 < 44 based on 40 stats

No comments:

Post a Comment