[master] bd35552 Use the presentation mode for controlling the way a field is rendered in varnishstat
Martin Blix Grydeland
martin at varnish-software.com
Tue Jan 27 17:17:56 CET 2015
commit bd3555260e4f148fa6c76a63697996a9bdcd7454
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date: Fri Jan 16 15:55:17 2015 +0100
Use the presentation mode for controlling the way a field is rendered in varnishstat
diff --git a/bin/varnishstat/varnishstat_curses.c b/bin/varnishstat/varnishstat_curses.c
index 4294999..48ae7fe 100644
--- a/bin/varnishstat/varnishstat_curses.c
+++ b/bin/varnishstat/varnishstat_curses.c
@@ -80,6 +80,7 @@ struct pt {
char *key;
char *name;
int semantics;
+ int format;
const volatile uint64_t *ptr;
char seen;
@@ -317,6 +318,7 @@ build_pt_list_cb(void *priv, const struct VSC_point *vpt)
pt->ptr = vpt->ptr;
pt->last = *pt->ptr;
pt->semantics = vpt->desc->semantics;
+ pt->format = vpt->desc->format;
pt->ma_10.nmax = 10;
pt->ma_100.nmax = 100;
@@ -692,7 +694,7 @@ draw_line_bitmap(WINDOW *w, int y, int x, int X, struct pt *pt)
AN(w);
AN(pt);
- assert(pt->semantics == 'b');
+ assert(pt->format == 'b');
col = 0;
while (col < COL_LAST) {
@@ -737,7 +739,7 @@ draw_line(WINDOW *w, int y, struct pt *pt)
mvwprintw(w, y, x, "%.*s", colw_name, pt->name);
x += colw_name;
- if (pt->semantics == 'b')
+ if (pt->format == 'b')
draw_line_bitmap(w, y, x, X, pt);
else
draw_line_default(w, y, x, X, pt);
More information about the varnish-commit
mailing list