summaryrefslogtreecommitdiffabout
path: root/src/stat.c
Unidiff
Diffstat (limited to 'src/stat.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/stat.c65
1 files changed, 35 insertions, 30 deletions
diff --git a/src/stat.c b/src/stat.c
index ed4ab8e..85b76d9 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -47,3 +47,3 @@ interpolate (queue_t *q,
47 th.outrate = outrate; 47 th.outrate = outrate;
48 verbose (3, "Insert %lu %g %g", next, th.inrate, th.outrate); 48 verbose (3, _("insert %lu %g %g"), next, th.inrate, th.outrate);
49 queue_put (q, &th); 49 queue_put (q, &th);
@@ -60,3 +60,3 @@ interpolate (queue_t *q,
60 / interval + last_rates->outrate; 60 / interval + last_rates->outrate;
61 verbose (3, "Insert %lu %g %g", next, th.inrate, th.outrate); 61 verbose (3, _("insert %lu %g %g"), next, th.inrate, th.outrate);
62 queue_put (q, &th); 62 queue_put (q, &th);
@@ -94,3 +94,3 @@ overflow (struct traffic_history *th,
94 tmp.outrate = avg->outrate; 94 tmp.outrate = avg->outrate;
95 verbose (3, "Insert %lu %g %g", now, tmp.inrate, tmp.outrate); 95 verbose (3, _("insert %lu %g %g"), now, tmp.inrate, tmp.outrate);
96 queue_put (q, &tmp); 96 queue_put (q, &tmp);
@@ -110,6 +110,7 @@ ovf_monthly (struct traffic_history *th, struct traffic_record *tr, time_t now)
110{ 110{
111 verbose (2, "begin overflow_monthly %lu %g %g", now, th->inrate, th->outrate); 111 verbose (2, _("begin overflow_monthly %lu %g %g"),
112 now, th->inrate, th->outrate);
112 overflow (th, tr, now, NULL, &tr->year_avg, &tr->year_hist, 113 overflow (th, tr, now, NULL, &tr->year_avg, &tr->year_hist,
113 YEAR_COUNT, YEAR_SAMPLE); 114 YEAR_COUNT, YEAR_SAMPLE);
114 verbose (2, "end overflow_monthly"); 115 verbose (2, _("end overflow_monthly"));
115} 116}
@@ -119,6 +120,7 @@ ovf_weekly (struct traffic_history *th, struct traffic_record *tr, time_t now)
119{ 120{
120 verbose (2, "begin overflow_weekly %lu %g %g", now, th->inrate, th->outrate); 121 verbose (2, _("begin overflow_weekly %lu %g %g"),
122 now, th->inrate, th->outrate);
121 overflow (th, tr, now, ovf_monthly, &tr->month_avg, &tr->month_hist, 123 overflow (th, tr, now, ovf_monthly, &tr->month_avg, &tr->month_hist,
122 MONTH_COUNT, MONTH_SAMPLE); 124 MONTH_COUNT, MONTH_SAMPLE);
123 verbose (2, "end overflow_daily"); 125 verbose (2, _("end overflow_daily"));
124} 126}
@@ -128,6 +130,7 @@ ovf_daily (struct traffic_history *th, struct traffic_record *tr, time_t now)
128{ 130{
129 verbose (2, "begin overflow_daily %lu %g %g", now, th->inrate, th->outrate); 131 verbose (2, _("begin overflow_daily %lu %g %g"),
132 now, th->inrate, th->outrate);
130 overflow (th, tr, now, ovf_weekly, &tr->week_avg, &tr->week_hist, 133 overflow (th, tr, now, ovf_weekly, &tr->week_avg, &tr->week_hist,
131 WEEK_COUNT, WEEK_SAMPLE); 134 WEEK_COUNT, WEEK_SAMPLE);
132 verbose (2, "end overflow_daily"); 135 verbose (2, _("end overflow_daily"));
133} 136}
@@ -146,3 +149,3 @@ update_stats (struct monitor *mon, struct traffic_sample *sample,
146 { 149 {
147 logmsg (L_ERR, "Ignoring zero interval"); 150 logmsg (L_ERR, _("ignoring zero interval"));
148 return; 151 return;
@@ -219,3 +222,3 @@ _convert (queue_t *q, ovf_t ovf,
219 { 222 {
220 logmsg (L_ERR, "Ignoring zero interval"); 223 logmsg (L_ERR, _("ignoring zero interval"));
221 break; 224 break;
@@ -254,3 +257,3 @@ convert_yearly (struct traffic_record *tr, struct traffic_sample *hp,
254{ 257{
255 verbose (2, "begin convert_yearly"); 258 verbose (2, _("begin convert_yearly"));
256 _convert (&tr->year_hist, NULL, tr, 259 _convert (&tr->year_hist, NULL, tr,
@@ -258,3 +261,3 @@ convert_yearly (struct traffic_record *tr, struct traffic_sample *hp,
258 compute_avg (&tr->year_avg, &tr->year_hist, &tr->last); 261 compute_avg (&tr->year_avg, &tr->year_hist, &tr->last);
259 verbose (2, "end convert_yearly"); 262 verbose (2, _("end convert_yearly"));
260} 263}
@@ -265,3 +268,3 @@ convert_monthly (struct traffic_record *tr, struct traffic_sample *hp,
265{ 268{
266 verbose (2, "begin convert_monthly"); 269 verbose (2, _("begin convert_monthly"));
267 if (count > MONTH_COUNT+1) 270 if (count > MONTH_COUNT+1)
@@ -271,3 +274,3 @@ convert_monthly (struct traffic_record *tr, struct traffic_sample *hp,
271 compute_avg (&tr->month_avg, &tr->month_hist, &tr->last); 274 compute_avg (&tr->month_avg, &tr->month_hist, &tr->last);
272 verbose (2, "end convert_monthly"); 275 verbose (2, _("end convert_monthly"));
273} 276}
@@ -277,3 +280,3 @@ convert_weekly (struct traffic_record *tr, struct traffic_sample *hp, size_t cou
277{ 280{
278 verbose (2, "begin convert_weekly"); 281 verbose (2, _("begin convert_weekly"));
279 if (count > WEEK_COUNT+1) 282 if (count > WEEK_COUNT+1)
@@ -283,3 +286,3 @@ convert_weekly (struct traffic_record *tr, struct traffic_sample *hp, size_t cou
283 compute_avg (&tr->week_avg, &tr->week_hist, &tr->last); 286 compute_avg (&tr->week_avg, &tr->week_hist, &tr->last);
284 verbose (2, "end convert_weekly"); 287 verbose (2, _("end convert_weekly"));
285} 288}
@@ -289,3 +292,3 @@ convert_daily (struct traffic_record *tr, struct traffic_sample *hp, size_t coun
289{ 292{
290 verbose (2, "begin convert_daily"); 293 verbose (2, _("begin convert_daily"));
291 if (count > DAY_COUNT+1) 294 if (count > DAY_COUNT+1)
@@ -293,3 +296,3 @@ convert_daily (struct traffic_record *tr, struct traffic_sample *hp, size_t coun
293 _convert (&tr->day_hist, ovf_daily, tr, hp, DAY_COUNT + 1, DAY_SAMPLE); 296 _convert (&tr->day_hist, ovf_daily, tr, hp, DAY_COUNT + 1, DAY_SAMPLE);
294 verbose (2, "end convert_daily"); 297 verbose (2, _("end convert_daily"));
295} 298}
@@ -331,6 +334,6 @@ import_log (const char *name)
331 { 334 {
332 logmsg (L_ERR, "cannot open `%s': %s", name, strerror (errno)); 335 logmsg (L_ERR, _("cannot open `%s': %s"), name, strerror (errno));
333 return 1; 336 return 1;
334 } 337 }
335 verbose (2, "Importing %s", name); 338 verbose (2, _("importing %s"), name);
336 339
@@ -339,3 +342,3 @@ import_log (const char *name)
339 { 342 {
340 logmsg (L_ERR, "%s:1: Unexpected number of fields", name); 343 logmsg (L_ERR, _("%s:1: unexpected number of fields"), name);
341 fclose (fp); 344 fclose (fp);
@@ -366,3 +369,3 @@ import_log (const char *name)
366 { 369 {
367 logmsg (L_WARNING, "%s:%lu: is corrupted", name, line); 370 logmsg (L_WARNING, _("%s:%lu: is corrupted"), name, line);
368 break; 371 break;
@@ -401,3 +404,3 @@ import_log (const char *name)
401 { 404 {
402 logmsg (L_ERR, "cannot find monitor `%s'", base); 405 logmsg (L_ERR, _("cannot find monitor `%s'"), base);
403 rc = 1; 406 rc = 1;
@@ -418,6 +421,7 @@ import (const char *dirname)
418 421
419 verbose (2, "Examining `%s'", dirname); 422 verbose (2, _("examining `%s'"), dirname);
420 423
421 if (stat (dirname, &st)) 424 if (stat (dirname, &st))
422 die (EX_OSERR, "cannot stat file `%s': %s", dirname, strerror (errno)); 425 die (EX_OSERR, _("cannot stat file `%s': %s"),
426 dirname, strerror (errno));
423 else if (S_ISREG (st.st_mode)) 427 else if (S_ISREG (st.st_mode))
@@ -452,6 +456,7 @@ import (const char *dirname)
452 case GLOB_NOSPACE: 456 case GLOB_NOSPACE:
453 die (EX_UNAVAILABLE, "cannot scan directory: %s", strerror (ENOMEM)); 457 die (EX_UNAVAILABLE, _("cannot scan directory: %s"),
458 strerror (ENOMEM));
454 459
455 case GLOB_ABORTED: 460 case GLOB_ABORTED:
456 die (EX_UNAVAILABLE, "scanning aborted"); 461 die (EX_UNAVAILABLE, _("scanning aborted"));
457 462
@@ -461,3 +466,3 @@ import (const char *dirname)
461 default: 466 default:
462 die (EX_UNAVAILABLE, "cannot scan directory `%s'", dirname); 467 die (EX_UNAVAILABLE, _("cannot scan directory `%s'"), dirname);
463 } 468 }
@@ -465,3 +470,3 @@ import (const char *dirname)
465 470
466 verbose (1, "Number of imported log files: %d", count); 471 verbose (1, _("number of imported log files: %d"), count);
467} 472}

Return to:

Send suggestions and report system problems to the System administrator.