Re: [Nagios-devel] Silly precision in a timing macros

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Silly precision in a timing macros

Post by Guest »

Jason Martin wrote:
> On Fri, Oct 29, 2004 at 09:51:40AM +1000, Stanley Hopcroft wrote:
>
>>Do you really need this accuracy ?
>>Milliseconds are fine for me. Prob Seconds are also.
>
> Seconds would be too course for measuring database row insertion
> times, perhaps tenths-of-a-milisecond would be enough. I was
> raising the point only because I happened to have seen that data
> in my output, not because I particularly needed it.
>

Database inserts are rarely done in less than 1 millisecond. The steps
involved are;
parse command
evaluate values
hash values
insert in hash tables
copy to in-house memory
flush to disk

If you want exact timings, do 1000 or 10000 consecutive inserts and get
an average. It will be much more accurate than timing a single insert
anyway, and production applications shouldn't really bother with timing
each insert. That's what testcases are for.

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Lead Developer





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked