On Tue, Aug 05, 2008 at 08:00:20PM +0200, [EMAIL PROTECTED] wrote:
>    Hmm, browsing through the code I found the following

I couldn't find this code in any of the branches we maintain but there seem to
be a close match in Michael's fork in :

  http://www.perzl.org/ganglia/src-3.0.7/libmetrics/aix/metrics.c

is this the version you are running?

>    void
>    update_ifdata( void )
>    {
>       ...
>       static double last_time = 0.0;  <-- (1)
>       double now, delta_t;
>       struct timeval timeValue;
>       struct timezone timeZone;
> 
>       gettimeofday( &timeValue, &timeZone );
> 
>       now = (double) (timeValue.tv_sec - boottime) + (timeValue.tv_usec /
>    1000000.0);
>       delta_t = now - last_time;    <-- will delta_t not always be equal to
>    now since last_time is reset everytime (1) ??

no; last_time is not reset every time that function is called (at least not by
the static definition you flagged).

at least in the version referred by the URL above, last_time always gets
updated to "now" on each call.

Carlo

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ganglia-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-general

Reply via email to