diff options
author | Christian Grothoff <christian@grothoff.org> | 2006-11-14 04:56:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2006-11-14 04:56:35 +0000 |
commit | ae02f5fd1f52d510d55d79b61b237d22fae2c586 (patch) | |
tree | 89beaa99f656357163d5ec17c3e4cef2d9417dc6 | |
parent | 52dc5c695886cafbc2ede9dd3ddbce768beeee9e (diff) | |
download | gnunet-gtk-ae02f5fd1f52d510d55d79b61b237d22fae2c586.tar.gz gnunet-gtk-ae02f5fd1f52d510d55d79b61b237d22fae2c586.zip |
more stats
-rw-r--r-- | src/plugins/stats/functions.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/plugins/stats/functions.c b/src/plugins/stats/functions.c index ffb99733..488a8410 100644 --- a/src/plugins/stats/functions.c +++ b/src/plugins/stats/functions.c | |||
@@ -140,6 +140,27 @@ static int getCPULoadStat(const void * closure, | |||
140 | return OK; | 140 | return OK; |
141 | } | 141 | } |
142 | 142 | ||
143 | static int getQuotaStat(const void * closure, | ||
144 | gfloat ** data) { | ||
145 | long long allowed; | ||
146 | long long have; | ||
147 | |||
148 | if (OK != getStatValue(&allowed, | ||
149 | NULL, | ||
150 | NULL, | ||
151 | "# bytes allowed in datastore")) | ||
152 | return SYSERR; | ||
153 | if (allowed == 0) | ||
154 | return SYSERR; | ||
155 | if (OK != getStatValue(&have, | ||
156 | NULL, | ||
157 | NULL, | ||
158 | "# bytes in datastore")) | ||
159 | return SYSERR; | ||
160 | data[0][0] = ((gfloat) have) / allowed; | ||
161 | return OK; | ||
162 | } | ||
163 | |||
143 | static int getTrafficRecvStats(const void * closure, | 164 | static int getTrafficRecvStats(const void * closure, |
144 | gfloat ** data) { | 165 | gfloat ** data) { |
145 | long long total; | 166 | long long total; |
@@ -427,7 +448,7 @@ static void updateStatValues(void * unused) { | |||
427 | 448 | ||
428 | 449 | ||
429 | StatEntry stats[] = { | 450 | StatEntry stats[] = { |
430 | { | 451 | { |
431 | gettext_noop("Connectivity"), | 452 | gettext_noop("Connectivity"), |
432 | gettext_noop("# connected nodes (100% = connection table size)"), | 453 | gettext_noop("# connected nodes (100% = connection table size)"), |
433 | &getConnectedNodesStat, | 454 | &getConnectedNodesStat, |
@@ -444,6 +465,14 @@ StatEntry stats[] = { | |||
444 | NO, | 465 | NO, |
445 | }, | 466 | }, |
446 | { | 467 | { |
468 | gettext_noop("Datastore capacity"), | ||
469 | gettext_noop("Data in datastore (in percent of allowed quota)"), | ||
470 | &getQuotaStat, | ||
471 | NULL, | ||
472 | 1, | ||
473 | NO, | ||
474 | }, | ||
475 | { | ||
447 | gettext_noop("Inbound Traffic"), | 476 | gettext_noop("Inbound Traffic"), |
448 | gettext_noop("Noise (red), Content (green), Queries (yellow), Hellos (blue), other (gray)"), | 477 | gettext_noop("Noise (red), Content (green), Queries (yellow), Hellos (blue), other (gray)"), |
449 | &getTrafficRecvStats, | 478 | &getTrafficRecvStats, |