Bug #38950 Quan shows no Execution time for "fast" queries on Windows
Submitted: 21 Aug 2008 23:04 Modified: 3 Nov 16:21
Reporter: Bill Weber
Status: Verified
Category:Monitoring: Agent Severity:S3 (Non-critical)
Version:2.0.0.7032 OS:Microsoft Windows
Assigned to: Kay Roepke Target Version:2.01 maint release

[21 Aug 2008 23:04] Bill Weber
Description:
On Windows, fast queries show as taking no time to execute on the Query Analysis tab
(Execution = 0.000). Note, the reason for this is that glib uses
GetSystemTimeAsFileTime() which has a 10ms accuracy.

How to repeat:
- install and start dashboard
- install and start an agent on Windows with query analysis turned on
- run some small/fast queries through the proxy
- go to Query Analysis page on dashboard
| notice Execution time = 0.000

Suggested fix:
 use something like this for windows:
 LARGE_INTEGER freq;
 LARGE_INTEGER startTime, endTime;
 LARGE_INTEGER elapsedTime, elapsedMilliseconds;
 QueryPerformanceFrequency(&freq);
 QueryPerformanceCounter(&startTime);
 / run code here
 QueryPerformanceCounter(&endTime);
 elapsedTime = endTime - startTime;
 elapsedMilliseconds = (1000 * elapsedTime) / freq;
[20 Aug 19:43] MC Brown
A note has been added to the documentation in the QA chapter on this issue.