size_t talloc_pool_size; //!< for each REQUEST
- fr_time_t checked_timeout; //!< when we last checked the tails of the queues
fr_worker_heap_t to_decode; //!< messages from the master, to be decoded or localized
fr_worker_heap_t localized; //!< localized messages to be decoded
bool was_sleeping; //!< used to suppress multiple sleep signals in a row
bool exiting; //!< are we exiting?
+ fr_time_t checked_timeout; //!< when we last checked the tails of the queues
+ fr_time_t last_event; //!< last time we ran the event loop
+
fr_time_t next_cleanup; //!< when we next do the max_request_time checks
fr_event_timer_t const *ev_cleanup; //!< timer for max_request_time
WORKER_VERIFY;
+ worker->last_event = fr_time();
+
/*
* There are runnable requests. We still service
* the event loop, but we don't wait for events.
fprintf(fp, "count.runnable\t%u\n", fr_heap_num_elements(worker->runnable));
when = worker->tracking.predicted;
- fprintf(fp, "cpu.predicted\t%u.%03u\n", (unsigned int) (when / NANOSEC), (unsigned int) (when % NANOSEC) / 1000);
+ fprintf(fp, "cpu.predicted\t%u.%03u\n", (unsigned int) (when / NANOSEC), (unsigned int) (when % NANOSEC) / 1000000);
when = worker->tracking.running;
- fprintf(fp, "cpu.used\t%u.%03u\n", (unsigned int) (when / NANOSEC), (unsigned int) (when % NANOSEC) / 1000);
+ fprintf(fp, "cpu.used\t%u.%03u\n", (unsigned int) (when / NANOSEC), (unsigned int) (when % NANOSEC) / 1000000);
when = worker->tracking.waiting;
- fprintf(fp, "cpu.waiting\t%u.%03u\n", (unsigned int) (when / NANOSEC), (unsigned int) (when % NANOSEC) / 1000);
+ fprintf(fp, "cpu.waiting\t%u.%03u\n", (unsigned int) (when / NANOSEC), (unsigned int) (when % NANOSEC) / 1000000);
+
+ when = fr_time() - worker->last_event;
+ fprintf(fp, "cpu.serviced\t-%u.%03u\n", (unsigned int) (when / NANOSEC), (unsigned int) (when % NANOSEC) / 1000000);
return 0;
}