.\"
.\" $Id$
.\"
-.Dd June 15, 2007
+.Dd June 28, 2007
.Dt VARNISHSTAT 1
.Os
.Sh NAME
The columns in the main display are, from left to right:
.Bl -enum
.It
-Total since startup
+Value
.It
-Per-second average in the period since last update
+Per-second average in the period since last update, or a period if the
+value can not be averaged
.It
-Per-second average over process lifetime
+Per-second average over process lifetime, or a period if the value can
+not be averaged
+.It
+Descriptive text
+.El
+.Pp
+When using the
+.Fl 1
+option, the columns in the output are, from left to right:
+.Bl -enum
+.It
+Symbolic entry name
+.It
+Value
+.It
+Per-second average over process lifetime, or a period if the value can
+not be averaged
.It
Descriptive text
.El
.Sh HISTORY
The
.Nm
-utility was developed by
+utility was originally developed by
.An Poul-Henning Kamp Aq phk@phk.freebsd.dk
-in cooperation with Verdens Gang AS and Linpro AS.
+in cooperation with Verdens Gang AS and Linpro AS, and later
+substantially rewritten by
+.An Dag-Erling Sm\(/orgrav Aq des@linpro.no .
This manual page was written by
.An Dag-Erling Sm\(/orgrav Aq des@linpro.no .
* All rights reserved.
*
* Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
+ * Author: Dag-Erling Smørgrav <des@linpro.no>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
noecho();
nonl();
intrflush(stdscr, false);
+ curs_set(0);
erase();
lt = 0;
rt = ts.tv_sec - VSL_stats->start_time;
up = rt;
- move(0, 0);
- printw("%*s\n", COLS - 1, VSL_Name());
- move(0, 0);
- if (rt > 86400) {
- printw("%dd+", rt / 86400);
- rt %= 86400;
- }
- printw("%02d:", rt / 3600);
- rt %= 3600;
- printw("%02d:", rt / 60);
- rt %= 60;
- printw("%02d", rt);
- move(1, 0);
- hit = (intmax_t)VSL_stats->cache_hit -
- (intmax_t)copy.cache_hit;
- miss = (intmax_t)VSL_stats->cache_miss -
- (intmax_t)copy.cache_miss;
+ mvprintw(0, 0, "%*s", COLS - 1, VSL_Name());
+ mvprintw(0, 0, "%d+%02d:%02d:%02d", rt / 86400,
+ (rt % 86400) / 3600, (rt % 3600) / 60, rt % 60);
+
+ hit = VSL_stats->cache_hit - copy.cache_hit;
+ miss = VSL_stats->cache_miss - copy.cache_miss;
hit /= lt;
miss /= lt;
if (hit + miss != 0) {
myexp(&a2, ratio, &n2, 100);
myexp(&a3, ratio, &n3, 1000);
}
- printw("Hitrate ratio: %8u %8u %8u\n", n1, n2, n3);
- printw("Hitrate avg: %8.4f %8.4f %8.4f\n", a1, a2, a3);
- printw("\n");
+ mvprintw(1, 0, "Hitrate ratio: %8u %8u %8u", n1, n2, n3);
+ mvprintw(2, 0, "Hitrate avg: %8.4f %8.4f %8.4f", a1, a2, a3);
- line = 0;
+ line = 3;
#define MAC_STAT(n, t, f, d) \
- if (++line < LINES - 4) { \
+ if (++line < LINES) { \
ju = VSL_stats->n; \
if (f == 'a') { \
- printw("%12ju %12.2f %12.2f %s\n", \
+ mvprintw(line, 0, "%12ju %12.2f %12.2f %s\n", \
ju, (ju - (intmax_t)copy.n)/lt, ju / up, d); \
copy.n = ju; \
} else { \
- printw("%12ju %12s %12s %s\n", ju, ". ", ". ", d); \
+ mvprintw(line, 0, "%12ju %12s %12s %s\n", \
+ ju, ". ", ". ", d); \
} \
}
#include "stat_field.h"