|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
WMQI Timestamp Arithmetic |
« View previous topic :: View next topic » |
Author |
Message
|
mverh |
Posted: Fri Mar 08, 2002 3:16 pm Post subject: |
|
|
Voyager
Joined: 06 Mar 2002 Posts: 97
|
Has anyone developed some ESQL where I can substract two timestamps to get the difference? |
|
Back to top |
|
 |
Miriam Kaestner |
Posted: Sat Mar 09, 2002 8:36 am Post subject: |
|
|
Centurion
Joined: 26 Jun 2001 Posts: 103 Location: IBM IT Education Services, Germany
|
Just subtract the two timestamps, but not that the result must be of data type INTERVAL. |
|
Back to top |
|
 |
mverh |
Posted: Wed Mar 13, 2002 6:33 am Post subject: |
|
|
Voyager
Joined: 06 Mar 2002 Posts: 97
|
Okay, I've written the ESQL to compute the difference between two timestamps and I've noticed something that is interesting and wonder if anyone else has seen this behaviour.
I have a simple flow that is:
MQInput->Compute1->Compute2->MQOutput
Compute1 gets the CURRENT_GMTTIMESTAMP (start) and places it in the Environment tree. It then parses the XML input message which contains a counter. This counter is used to control a loop which adds an element to an output message. So if my input message looks like <Message><Counter>5000</Counter></Message> I loop 5000 times and adds the element Loop to the input message so the output message looks like <Message><Counter>5000</Counter><Loop>5000</Loop></Message>
Compute2 recieves control and gets the CURRENT_GMTTIMESTAMP (end) then reads the Enviroment tree to get the start time and substracts this from the end time and places it in the output message.
Now what is intriguing is that it appears the granuarity of the register CURRENT_GMTTIMESTAMP is somewhere around 15-16 ms. I deduce this by lowering the Counter in the input message until my elapsed time tends to zero. When I do this and pump hundreds of messages through the flow my elapsed time is either 0, 15 or 16 ms and never anything else. If I then increase the Counter slightly my elapsed times are either 15, 16, 31 or 32.
Has anyone else done this testing and seen this behaviour? Does anyone know of a way of getting the system time in real time such that these calculations can be made meaningful?
|
|
Back to top |
|
 |
kirani |
Posted: Wed Mar 13, 2002 5:33 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
|
Back to top |
|
 |
mverh |
Posted: Thu Mar 14, 2002 11:10 am Post subject: |
|
|
Voyager
Joined: 06 Mar 2002 Posts: 97
|
The ExecuteTime plugin won't do since we need to have the timing numbers as part of the message itself...execute time writes to the event log and it is difficult if not impossible to correlate the log entries to an individual message...IMHO ExecuteTime should include the MsgId and CorrelId in the event it logs...this would help... |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|