aboutsummaryrefslogtreecommitdiff
path: root/src/stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stat.c')
-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
@@ -46,5 +46,5 @@ interpolate (queue_t *q,
th.inrate = inrate;
th.outrate = outrate;
- verbose (3, "Insert %lu %g %g", next, th.inrate, th.outrate);
+ verbose (3, _("insert %lu %g %g"), next, th.inrate, th.outrate);
queue_put (q, &th);
if (ovf)
@@ -59,5 +59,5 @@ interpolate (queue_t *q,
th.outrate = (outrate - last_rates->outrate) * (next - last_time)
/ interval + last_rates->outrate;
- verbose (3, "Insert %lu %g %g", next, th.inrate, th.outrate);
+ verbose (3, _("insert %lu %g %g"), next, th.inrate, th.outrate);
queue_put (q, &th);
if (ovf)
@@ -93,5 +93,5 @@ overflow (struct traffic_history *th,
tmp.inrate = avg->inrate;
tmp.outrate = avg->outrate;
- verbose (3, "Insert %lu %g %g", now, tmp.inrate, tmp.outrate);
+ verbose (3, _("insert %lu %g %g"), now, tmp.inrate, tmp.outrate);
queue_put (q, &tmp);
}
@@ -109,8 +109,9 @@ int
ovf_monthly (struct traffic_history *th, struct traffic_record *tr, time_t now)
{
- verbose (2, "begin overflow_monthly %lu %g %g", now, th->inrate, th->outrate);
+ verbose (2, _("begin overflow_monthly %lu %g %g"),
+ now, th->inrate, th->outrate);
overflow (th, tr, now, NULL, &tr->year_avg, &tr->year_hist,
YEAR_COUNT, YEAR_SAMPLE);
- verbose (2, "end overflow_monthly");
+ verbose (2, _("end overflow_monthly"));
}
@@ -118,8 +119,9 @@ int
ovf_weekly (struct traffic_history *th, struct traffic_record *tr, time_t now)
{
- verbose (2, "begin overflow_weekly %lu %g %g", now, th->inrate, th->outrate);
+ verbose (2, _("begin overflow_weekly %lu %g %g"),
+ now, th->inrate, th->outrate);
overflow (th, tr, now, ovf_monthly, &tr->month_avg, &tr->month_hist,
MONTH_COUNT, MONTH_SAMPLE);
- verbose (2, "end overflow_daily");
+ verbose (2, _("end overflow_daily"));
}
@@ -127,8 +129,9 @@ int
ovf_daily (struct traffic_history *th, struct traffic_record *tr, time_t now)
{
- verbose (2, "begin overflow_daily %lu %g %g", now, th->inrate, th->outrate);
+ verbose (2, _("begin overflow_daily %lu %g %g"),
+ now, th->inrate, th->outrate);
overflow (th, tr, now, ovf_weekly, &tr->week_avg, &tr->week_hist,
WEEK_COUNT, WEEK_SAMPLE);
- verbose (2, "end overflow_daily");
+ verbose (2, _("end overflow_daily"));
}
@@ -145,5 +148,5 @@ update_stats (struct monitor *mon, struct traffic_sample *sample,
if (interval == 0)
{
- logmsg (L_ERR, "Ignoring zero interval");
+ logmsg (L_ERR, _("ignoring zero interval"));
return;
}
@@ -218,5 +221,5 @@ _convert (queue_t *q, ovf_t ovf,
if (interval == 0)
{
- logmsg (L_ERR, "Ignoring zero interval");
+ logmsg (L_ERR, _("ignoring zero interval"));
break;
}
@@ -253,9 +256,9 @@ convert_yearly (struct traffic_record *tr, struct traffic_sample *hp,
size_t count)
{
- verbose (2, "begin convert_yearly");
+ verbose (2, _("begin convert_yearly"));
_convert (&tr->year_hist, NULL, tr,
hp, count, YEAR_SAMPLE);
compute_avg (&tr->year_avg, &tr->year_hist, &tr->last);
- verbose (2, "end convert_yearly");
+ verbose (2, _("end convert_yearly"));
}
@@ -264,5 +267,5 @@ convert_monthly (struct traffic_record *tr, struct traffic_sample *hp,
size_t count)
{
- verbose (2, "begin convert_monthly");
+ verbose (2, _("begin convert_monthly"));
if (count > MONTH_COUNT+1)
convert_yearly (tr, hp + MONTH_COUNT + 1, count - (MONTH_COUNT + 1));
@@ -270,5 +273,5 @@ convert_monthly (struct traffic_record *tr, struct traffic_sample *hp,
hp, MONTH_COUNT + 1, MONTH_SAMPLE);
compute_avg (&tr->month_avg, &tr->month_hist, &tr->last);
- verbose (2, "end convert_monthly");
+ verbose (2, _("end convert_monthly"));
}
@@ -276,5 +279,5 @@ static void
convert_weekly (struct traffic_record *tr, struct traffic_sample *hp, size_t count)
{
- verbose (2, "begin convert_weekly");
+ verbose (2, _("begin convert_weekly"));
if (count > WEEK_COUNT+1)
convert_monthly (tr, hp + WEEK_COUNT + 1, count - (WEEK_COUNT + 1));
@@ -282,5 +285,5 @@ convert_weekly (struct traffic_record *tr, struct traffic_sample *hp, size_t cou
tr, hp, WEEK_COUNT + 1, WEEK_SAMPLE);
compute_avg (&tr->week_avg, &tr->week_hist, &tr->last);
- verbose (2, "end convert_weekly");
+ verbose (2, _("end convert_weekly"));
}
@@ -288,9 +291,9 @@ static void
convert_daily (struct traffic_record *tr, struct traffic_sample *hp, size_t count)
{
- verbose (2, "begin convert_daily");
+ verbose (2, _("begin convert_daily"));
if (count > DAY_COUNT+1)
convert_weekly (tr, hp + DAY_COUNT + 1, count - (DAY_COUNT + 1));
_convert (&tr->day_hist, ovf_daily, tr, hp, DAY_COUNT + 1, DAY_SAMPLE);
- verbose (2, "end convert_daily");
+ verbose (2, _("end convert_daily"));
}
@@ -330,13 +333,13 @@ import_log (const char *name)
if (!fp)
{
- logmsg (L_ERR, "cannot open `%s': %s", name, strerror (errno));
+ logmsg (L_ERR, _("cannot open `%s': %s"), name, strerror (errno));
return 1;
}
- verbose (2, "Importing %s", name);
+ verbose (2, _("importing %s"), name);
if (fscanf (fp, "%ld %lu %lu\n", &last.time, &last.in, &last.out) != 3)
{
- logmsg (L_ERR, "%s:1: Unexpected number of fields", name);
+ logmsg (L_ERR, _("%s:1: unexpected number of fields"), name);
fclose (fp);
return 1;
@@ -365,5 +368,5 @@ import_log (const char *name)
if (hist.time > cur)
{
- logmsg (L_WARNING, "%s:%lu: is corrupted", name, line);
+ logmsg (L_WARNING, _("%s:%lu: is corrupted"), name, line);
break;
}
@@ -400,5 +403,5 @@ import_log (const char *name)
if (!mon)
{
- logmsg (L_ERR, "cannot find monitor `%s'", base);
+ logmsg (L_ERR, _("cannot find monitor `%s'"), base);
rc = 1;
}
@@ -417,8 +420,9 @@ import (const char *dirname)
struct stat st;
- verbose (2, "Examining `%s'", dirname);
+ verbose (2, _("examining `%s'"), dirname);
if (stat (dirname, &st))
- die (EX_OSERR, "cannot stat file `%s': %s", dirname, strerror (errno));
+ die (EX_OSERR, _("cannot stat file `%s': %s"),
+ dirname, strerror (errno));
else if (S_ISREG (st.st_mode))
{
@@ -451,8 +455,9 @@ import (const char *dirname)
case GLOB_NOSPACE:
- die (EX_UNAVAILABLE, "cannot scan directory: %s", strerror (ENOMEM));
+ die (EX_UNAVAILABLE, _("cannot scan directory: %s"),
+ strerror (ENOMEM));
case GLOB_ABORTED:
- die (EX_UNAVAILABLE, "scanning aborted");
+ die (EX_UNAVAILABLE, _("scanning aborted"));
case GLOB_NOMATCH:
@@ -460,9 +465,9 @@ import (const char *dirname)
default:
- die (EX_UNAVAILABLE, "cannot scan directory `%s'", dirname);
+ die (EX_UNAVAILABLE, _("cannot scan directory `%s'"), dirname);
}
}
- verbose (1, "Number of imported log files: %d", count);
+ verbose (1, _("number of imported log files: %d"), count);
}

Return to:

Send suggestions and report system problems to the System administrator.