From 316180d885042b7ea2f2f1f67c3175c0a1ad41fa Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 15 Sep 2014 16:35:34 +0200 Subject: status: add uptime and established times --- src/status.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/status.c') diff --git a/src/status.c b/src/status.c index 0e688a5..fd34747 100644 --- a/src/status.c +++ b/src/status.c @@ -115,6 +115,8 @@ static json_object * dump_peer(const fastd_peer_t *peer) { if (fastd_peer_is_established(peer)) { connection = json_object_new_object(); + json_object_object_add(connection, "established", json_object_new_int64(ctx.now - peer->established)); + struct json_object *method = NULL; const fastd_method_info_t *method_info = conf.protocol->get_current_method(peer); @@ -158,6 +160,8 @@ static json_object * dump_peer(const fastd_peer_t *peer) { static void dump_status(int fd) { struct json_object *json = json_object_new_object(); + json_object_object_add(json, "uptime", json_object_new_int64(ctx.now - ctx.started)); + json_object_object_add(json, "statistics", dump_stats(&ctx.stats)); struct json_object *peers = json_object_new_object(); -- cgit v1.2.3