- docs
[oweals/gnunet.git] / src / testbed / gnunet-service-testbed_cpustatus.c
index 6caea97613d3c95fc8c74d534eb121cb6c978e9e..4b61a039c861cab6acebcec530b52a92fc926347 100644 (file)
@@ -527,7 +527,7 @@ updateAgedLoad ()
 
   age = GNUNET_TIME_absolute_get_duration (lastCall);
   if ( (agedCPULoad == -1)
-       || (age.rel_value > 500) )
+       || (age.rel_value_us > 500000) )
     {
       /* use smoothing, but do NOT update lastRet at frequencies higher
          than 500ms; this makes the smoothing (mostly) independent from
@@ -667,16 +667,16 @@ sample_load_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   nproc = 0;
 #endif
   now = GNUNET_TIME_absolute_get ();
-  nbs = GNUNET_asprintf (&str, "%llu %d %d %u %u\n", now.abs_value / 1000,
+  nbs = GNUNET_asprintf (&str, "%llu %d %d %u %u\n", now.abs_value_us / 1000LL / 1000LL,
                          ld_cpu, ld_disk, mem_usage, nproc);
   if (0 < nbs) 
   {
     GNUNET_BIO_write (bw, str, nbs);
-    GNUNET_free (str);
   }
   else
     GNUNET_break (0);
-
+  GNUNET_free (str);
+  
  reschedule:
   sample_load_task_id =
       GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,