diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2010-12-17 22:06:11 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2010-12-17 22:06:11 +0300 |
commit | e8507d40aa9d55eb3af6196584bf3118d4f08050 (patch) | |
tree | ebb0bbb4f5bab99b6496d7beb64888a403465973 /accel-pptpd/cli/std_cmd.c | |
parent | 33845548dbae8fb6b798afb135b1aab60ab19093 (diff) | |
download | accel-ppp-e8507d40aa9d55eb3af6196584bf3118d4f08050.tar.gz accel-ppp-e8507d40aa9d55eb3af6196584bf3118d4f08050.zip |
cli: show uptime in statistics
Diffstat (limited to 'accel-pptpd/cli/std_cmd.c')
-rw-r--r-- | accel-pptpd/cli/std_cmd.c | 11 |
1 files changed, 11 insertions, 0 deletions
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); |