.Nm
.Op Fl 1
.Op Fl V
+.Op Fl w Ar delay
.Sh DESCRIPTION
The
.Nm
statistics once and exit.
.It Fl V
Display the version number and exit.
+.It Fl w Ar delay
+Wait
+.Ar delay
+seconds between updates.
+The default is 1.
.El
.Pp
The columns in the main display are, from left to right:
.It
Total since startup
.It
-Delta since last update (normally the last second)
+Delta since last update
.It
Average over process lifetime
.It
}
static void
-do_curses(struct varnish_stats *VSL_stats)
+do_curses(struct varnish_stats *VSL_stats, int delay)
{
struct varnish_stats copy;
intmax_t ju;
#undef MAC_STAT
lt = tt;
refresh();
- sleep(1);
+ sleep(delay);
}
}
static void
usage(void)
{
- fprintf(stderr, "usage: varnishstat [-1V]\n");
+ fprintf(stderr, "usage: varnishstat [-1V] [-w delay]\n");
exit(1);
}
{
int c;
struct varnish_stats *VSL_stats;
- int once = 0;
+ int delay = 1, once = 0;
VSL_stats = VSL_OpenStats();
- while ((c = getopt(argc, argv, "1V")) != -1) {
+ while ((c = getopt(argc, argv, "1Vw:")) != -1) {
switch (c) {
case '1':
once = 1;
case 'V':
varnish_version("varnishstat");
exit(0);
+ case 'w':
+ delay = atoi(optarg);
+ break;
default:
usage();
}
}
if (!once) {
- do_curses(VSL_stats);
+ do_curses(VSL_stats, delay);
} else {
#define MAC_STAT(n,t,f,d) \