Author |
Message
|
Rush124 |
Posted: Mon Aug 18, 2014 10:07 pm Post subject: Accuracy of MQMD->puttime |
|
|
Novice
Joined: 05 Aug 2014 Posts: 19
|
Hi all,
I read that the Accuracy of MQMD->puttime is upto 0.01 seconds.
Is there a way to increase this accuracy to 1 millisecond or lower??
thanks in advance
 |
|
Back to top |
|
 |
PaulClarke |
Posted: Mon Aug 18, 2014 11:58 pm Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
No, I'm afraid you can't. The PutTime field has a fixed size and therefore there isn't any space to put a higher resolution timer.
Of course you could write an API exit and add your own high resolution timer in the form of a message property. However, I think the question is why do you need this ? What are you trying to achieve ? There may be better ways of achieving what you want using the standard MQ product.
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
Rush124 |
Posted: Tue Aug 19, 2014 12:52 am Post subject: |
|
|
Novice
Joined: 05 Aug 2014 Posts: 19
|
Thanks for replying, Paul.
I am trying to measure the time taken for a process.
This process starts when a Message is put to a Queue and ends with putting a correlated message to another queue.
So I'm calculating the difference between puttimes.
Anyhow is it possible to enter new attributes to MQMD? |
|
Back to top |
|
 |
PaulClarke |
Posted: Tue Aug 19, 2014 12:59 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
You can't add new attributes to an MQMD but it's fairly easy to add a message property to a message.
I'm a little surprised at your start and end points. It includes one queue time but not the other. I would have thought one might want to measure.
a) How long a message languishes on a queue
b) How long the processing of a message takes
Would it not be better to have these thing independent?
Having said that, in your case, why not just have the originator of the request add a high resolution timestamp 'RequestTime' to the original message ?
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Aug 19, 2014 5:33 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Rush124 wrote: |
Thanks for replying, Paul.
I am trying to measure the time taken for a process.
This process starts when a Message is put to a Queue and ends with putting a correlated message to another queue.
So I'm calculating the difference between puttimes.
Anyhow is it possible to enter new attributes to MQMD? |
Keep in mind that these times may make no meaning at all.
If the reply processing server is different from the requesting server you need to make sure your servers are time synchronised...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
PeterPotkay |
Posted: Tue Aug 19, 2014 6:26 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
fjb_saper wrote: |
Keep in mind that these times may make no meaning at all.
If the reply processing server is different from the requesting server you need to make sure your servers are time synchronised...  |
And suitably authorized apps can set the Put Time themselves. Who knows how careful they are in setting an accurate value. Why, they may simply copy the value from the request message into the header of the reply message, even though they spent 10 seconds working that message. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
tczielke |
Posted: Tue Aug 19, 2014 6:44 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
Also, if microsecond timings are being done on a server with multiple x86 processors, be ready for the potential that if you take a timestamp at time A and time A+x (in the future of A), there is the potential (albeit rare) of getting a zero or negative value due to TSC register drifting between separate processors. |
|
Back to top |
|
 |
Rush124 |
Posted: Tue Aug 19, 2014 10:51 pm Post subject: |
|
|
Novice
Joined: 05 Aug 2014 Posts: 19
|
Thanks all for the valuable replies.
However in my case we can't change the original message that is put to the Queue. So as paul mentioned
Quote: |
"add a high resolution timestamp 'RequestTime' to the original message ?" |
is not an option.
Also both the Queues are in the same server always.
This is a simple tool which adds message to say INQueue1 and waits for a callback from the OUTQueue1 and checks if both the messages are correlated and prints the time that the message was added to the INQueue1 and reply came to OutQueue1 and finally the time taken to process the message at our internal system. The output is as below.
Code: |
(INQueue1->PutTime) = 6331373 & (OUTQueue1->GetTime) = 6331374 (Difference -> ) = 1
(INQueue1->PutTime) = 6331374 & (OUTQueue1->GetTime) = 6331374 (Difference -> ) = 0 |
Always its 0 or 1. How can we get a larger precision ? |
|
Back to top |
|
 |
exerk |
Posted: Wed Aug 20, 2014 12:15 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Again - why do you need this level of precision? _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
Rush124 |
Posted: Wed Aug 20, 2014 12:52 am Post subject: |
|
|
Novice
Joined: 05 Aug 2014 Posts: 19
|
exerk wrote: |
Again - why do you need this level of precision? |
HI, because the client need to do a proof testing of the system by adding messages of different sizes in different rates ( like 100messages per second with size 1K ). So we need to show exact time that the system takes to process a one message and give the output.
Since the time difference is in 100s of a second, the value is either 0 millisecond or 10 millisecond always. So it should be between 0 to 19 milliseconds exactly. So need to get the exact precision.. Is that clear enough for you ? |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Aug 20, 2014 1:10 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
What is your 'Plan B'?
It seems clear from the answers so far that the Puttime precision is not enough for you.
some suggestions have been made as to alternatives.
You could add a seconds + milliseconds to one of the other fields in the MQMD and then use that to get your answer. The Application Identity or application Origin Data fields might be suitable for your purpose but remember these are fixed length fields. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
exerk |
Posted: Wed Aug 20, 2014 1:29 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Rush124 wrote: |
...we need to show exact time that the system takes to process a one message and give the output. |
Is there an SLA or solution requirement that must be adhered to, i.e. that a message of a given size must be processed within 'n' milliseconds? Do you need to prove to that client that of the 'n' seconds it takes to process a messages only a fraction of that time is spent in MQ? If you need that level of precision, and require continuing proof that you're meeting the requirement, use a monitoring application that has the ability to transaction-monitor down to that level of accuracy (I can think of at least one that can do it). _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
|