Why is the Execution time of a particular activity or a process reported by Admin/Hawk different from CPU time reported by Operating System?
book
Article ID: KB0092283
calendar_today
Updated On:
Products
Versions
TIBCO ActiveMatrix BusinessWorks
-
Not Applicable
-
Description
Resolution: Hawk micro agent uses the java api System.currentTimeMillis() to keep track of the time taken by a particular activity. Hence execution time reported by hawk micro agent is a difference between two calls, one just before beginning of the activity and the other after finishing of the activity, to method System.currentTimeMillis() minus any sleep/wait/call-process time.
If you look at the BW documentation ================= TIBCO BusinessWorks Palette Reference
Chapter 5 General Activities Palette
ExecutionTime : Total clock time (in milliseconds) used by all executions of this activity. This does not include waiting time for Sleep, Call Process, and Wait For... activities. ==================
Where as UNIX manual pages define time reported by ps command as
cpu time (including both user and system time)
http://www.hmug.org/man/1/ps.php
There could be difference between these two times due to several reasons, some of them being
1. OS keeps track of all the time taken by the bwengine process. Especially the startup of the bwengine itself takes some time and that is not taken into account when you look at the times reported by hawk microagent for different activities in a process.
2. Hawk microagent takes the thread wait time in "Runnable" state also as CPU time. If there is lot of load on the machine, even though activity thread is ready to run, it may not be able to obtain the CPU and hence it will wait in that state till it gets CPU. There is no way to keep track the time only when thread in running. But OS should have the exact time thread is run hence there would be a difference.
3. There are some additional threads that run in bwengine like pager thread, job scheduling threads etc. Time taken by these threads doesn't come into hawk micro agent metrics. At the same time OS would capture this time against bwengine cpu time.
Issue/Introduction
Why is the Execution time of a particular activity or a process reported by Admin/Hawk different from CPU time reported by Operating System?