Skip to content
Snippets Groups Projects
Commit 3446a077 authored by Yuriy Vostrikov's avatar Yuriy Vostrikov
Browse files

[core] repair statistics

parent f0295105
No related branches found
No related tags found
No related merge requests found
...@@ -108,11 +108,11 @@ stat_print(struct tbuf *buf) ...@@ -108,11 +108,11 @@ stat_print(struct tbuf *buf)
void void
stat_age(ev_timer *timer, int events __unused__) stat_age(ev_timer *timer, int events __unused__)
{ {
if (stats == NULL) for (int i = 0; i < stats_max; i++) {
return; if (stats[i].name == NULL)
continue;
for (int i = 0; stats[i].name != NULL; i++) { for (int j = SECS - 2; j >= 0; j--)
for (int j = 0; j < SECS - 1; j++)
stats[i].value[j + 1] = stats[i].value[j]; stats[i].value[j + 1] = stats[i].value[j];
stats[i].value[0] = 0; stats[i].value[0] = 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment