From e8507d40aa9d55eb3af6196584bf3118d4f08050 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Fri, 17 Dec 2010 22:06:11 +0300 Subject: cli: show uptime in statistics --- accel-pptpd/cli/std_cmd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'accel-pptpd/cli') diff --git a/accel-pptpd/cli/std_cmd.c b/accel-pptpd/cli/std_cmd.c index 673d2778..2ff77282 100644 --- a/accel-pptpd/cli/std_cmd.c +++ b/accel-pptpd/cli/std_cmd.c @@ -14,6 +14,17 @@ static int show_stat_exec(const char *cmd, char * const *fields, int fields_cnt, void *client) { + time_t dt; + int day,hour; + + time(&dt); + dt -= triton_stat.start_time; + day = dt / (60 * 60 * 24); + dt %= 60 * 60 * 24; + hour = dt / (60 * 60); + dt %= 60 * 60; + + cli_sendv(client, "uptime: %i.%02i:%02i:%02i\r\n", day, hour, dt / 60, dt % 60); cli_send(client, "core:\r\n"); cli_sendv(client, " mempool_allocated: %u\r\n", triton_stat.mempool_allocated); cli_sendv(client, " mempool_available: %u\r\n", triton_stat.mempool_available); -- cgit v1.2.3