|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
  |
|
amqsact bug with time selection |
View previous topic :: View next topic |
Author |
Message
|
tczielke |
Posted: Thu Jul 02, 2015 12:21 pm Post subject: amqsact bug with time selection |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
FYI – If you use the amqsact sample program for Activity Tracing, there is a bug in how the -s (startTime) and -e (endTime) switches work to only find records for a given time range. There is a bug in both the start and end time check.
The amqsact logic has the following to build one of the tm structures that is used for the check.
Code: |
sscanf(MsgStartTime, "%2u.%2u.%2u",
&(startTm.tm_hour),
&(startTm.tm_min),
&(startTm.tm_sec));
|
However, MsgStartTime has a format like “13:11:01”. This causes some of these fields in the tm structure to not get parsed correctly, and therefore the time selection does not work correctly.
The amqsact code needs to be changed to the following to work correctly for the time selection:
Code: |
sscanf(MsgStartTime, "%2u:%2u:%2u",
&(startTm.tm_hour),
&(startTm.tm_min),
&(startTm.tm_sec));
.
.
sscanf(MsgEndTime, "%2u:%2u:%2u",
&(endTm.tm_hour),
&(endTm.tm_min),
&(endTm.tm_sec));
|
The format of how amqsact reads in the -s and -e is a little odd (i.e. 2017-07-07 11.15.00), but not a bug:
Code: |
sscanf(pval, "%4u-%2u-%2u %2u.%2u.%2u",
&(startTime.tm_year),
&(startTime.tm_mon),
&(startTime.tm_mday),
&(startTime.tm_hour),
&(startTime.tm_min),
&(startTime.tm_sec));
|
For my own custom version of amqsact that I use, I changed it to the following (i.e. 2017-07-02T11:15:00)
Code: |
sscanf(pval, "%4u-%2u-%2uT%2u:%2u:%2u",
&(startTime.tm_year),
&(startTime.tm_mon),
&(startTime.tm_mday),
&(startTime.tm_hour),
&(startTime.tm_min),
&(startTime.tm_sec));
|
I am not sure how this time selection part of the amqsact sample was tested successfully, as it mostly just does not work with the current bug. _________________ Working with MQ since 2010. |
|
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
|
|
|
|