mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
make statistics easier to read
This commit is contained in:
parent
61e2bd723d
commit
11c4c61952
3 changed files with 7 additions and 8 deletions
|
@ -377,12 +377,12 @@ int hook_stats(struct path *p, struct hook *h, int when)
|
|||
char *buf = path_print(p);
|
||||
|
||||
if (p->received > 1)
|
||||
stats("%-40s|%10.2g|%10.2f|%10u|%10u|%10u|%10u|%10u|%10u|%10u|", buf,
|
||||
stats("%-.40s|%10.2g|%10.2f|%10u|%10u|%10u|%10u|%10u|%10u|%10u|", buf,
|
||||
p->hist_owd.last, 1 / p->hist_gap_msg.last,
|
||||
p->sent, p->received, p->dropped, p->skipped, p->invalid, p->overrun, list_length(p->current)
|
||||
);
|
||||
else
|
||||
stats("%-40s|%10s|%10s|%10u|%10u|%10u|%10u|%10u|%10u|%10s|", buf, "", "",
|
||||
stats("%-.40s|%10s|%10s|%10u|%10u|%10u|%10u|%10u|%10u|%10s|", buf, "", "",
|
||||
p->sent, p->received, p->dropped, p->skipped, p->invalid, p->overrun, ""
|
||||
);
|
||||
|
||||
|
|
|
@ -198,13 +198,11 @@ char * path_print(struct path *p)
|
|||
{
|
||||
char *buf = alloc(32);
|
||||
|
||||
strcatf(&buf, "%s " MAG("=>") " [", p->in->name);
|
||||
strcatf(&buf, "%s " MAG("=>"), p->in->name);
|
||||
|
||||
list_foreach(struct node *n, &p->destinations)
|
||||
strcatf(&buf, " %s", n->name);
|
||||
|
||||
strcatf(&buf, " ]");
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
|
|
@ -191,10 +191,11 @@ int main(int argc, char *argv[])
|
|||
if (settings.stats > 0) {
|
||||
hook_stats_header();
|
||||
|
||||
do list_foreach(struct path *p, &paths) {
|
||||
for (;;) {
|
||||
list_foreach(struct path *p, &paths)
|
||||
path_run_hook(p, HOOK_PERIODIC);
|
||||
usleep(settings.stats * 1e6);
|
||||
path_run_hook(p, HOOK_PERIODIC);
|
||||
} while (1);
|
||||
}
|
||||
}
|
||||
else
|
||||
pause();
|
||||
|
|
Loading…
Add table
Reference in a new issue