summaryrefslogtreecommitdiff
path: root/src/feature/control
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-06 09:30:55 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-06 09:30:55 -0400
commite95b13f8ce383634eb10dc0a634971fb020daa76 (patch)
treec29a9d7c872e4d52b1cb817a6d21f410b0374cd5 /src/feature/control
parentbcfab63ca5713638cc2155a8870e51657a2a0ef2 (diff)
parent4ba26f95d5b2ba8a3795317f4777bfefff0e62a9 (diff)
downloadtor-e95b13f8ce383634eb10dc0a634971fb020daa76.tar.gz
tor-e95b13f8ce383634eb10dc0a634971fb020daa76.zip
Merge remote-tracking branch 'ageis/control-getinfo-uptime'
Diffstat (limited to 'src/feature/control')
-rw-r--r--src/feature/control/control.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/feature/control/control.c b/src/feature/control/control.c
index 61d1ebd8bf..9e7d21308e 100644
--- a/src/feature/control/control.c
+++ b/src/feature/control/control.c
@@ -1896,6 +1896,9 @@ getinfo_helper_misc(control_connection_t *conn, const char *question,
tor_asprintf(answer, "%"PRIu64, (get_bytes_read()));
} else if (!strcmp(question, "traffic/written")) {
tor_asprintf(answer, "%"PRIu64, (get_bytes_written()));
+ } else if (!strcmp(question, "uptime")) {
+ long uptime_secs = get_uptime();
+ tor_asprintf(answer, "%ld", uptime_secs);
} else if (!strcmp(question, "process/pid")) {
int myPid = -1;
@@ -3360,6 +3363,7 @@ static const getinfo_item_t getinfo_items[] = {
ITEM("traffic/read", misc,"Bytes read since the process was started."),
ITEM("traffic/written", misc,
"Bytes written since the process was started."),
+ ITEM("uptime", misc, "Uptime of the Tor daemon in seconds."),
ITEM("process/pid", misc, "Process id belonging to the main tor process."),
ITEM("process/uid", misc, "User id running the tor process."),
ITEM("process/user", misc,