Commit 285036ab authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Add verbosity filter to interactive varnishstat

Show UNSEEN in bottom bar when not hiding unseened counters
parent 4cf3e419
...@@ -113,6 +113,7 @@ static WINDOW *w_points = NULL; ...@@ -113,6 +113,7 @@ static WINDOW *w_points = NULL;
static WINDOW *w_bar_b = NULL; static WINDOW *w_bar_b = NULL;
static WINDOW *w_info = NULL; static WINDOW *w_info = NULL;
static int verbosity = VSC_level_info;
static int keep_running = 1; static int keep_running = 1;
static int show_info = 1; static int show_info = 1;
static int hide_unseen = 1; static int hide_unseen = 1;
...@@ -198,6 +199,8 @@ build_pt_array(void) ...@@ -198,6 +199,8 @@ build_pt_array(void)
CHECK_OBJ_NOTNULL(pt, PT_MAGIC); CHECK_OBJ_NOTNULL(pt, PT_MAGIC);
if (!pt->seen && hide_unseen) if (!pt->seen && hide_unseen)
continue; continue;
if (pt->vpt->desc->level->verbosity > verbosity)
continue;
assert(n_ptarray < n_ptlist); assert(n_ptarray < n_ptlist);
ptarray[n_ptarray++] = pt; ptarray[n_ptarray++] = pt;
} }
...@@ -722,11 +725,13 @@ draw_points(void) ...@@ -722,11 +725,13 @@ draw_points(void)
static void static void
draw_bar_b(void) draw_bar_b(void)
{ {
int x; int x, X;
const struct VSC_level_desc *level;
AN(w_bar_b); AN(w_bar_b);
x = 0; x = 0;
X = getmaxx(w_bar_b);
werase(w_bar_b); werase(w_bar_b);
if (page_start + l_points < n_ptarray) if (page_start + l_points < n_ptarray)
mvwaddch(w_bar_b, 0, x, ACS_DARROW); mvwaddch(w_bar_b, 0, x, ACS_DARROW);
...@@ -734,6 +739,13 @@ draw_bar_b(void) ...@@ -734,6 +739,13 @@ draw_bar_b(void)
if (current < n_ptarray - 1) if (current < n_ptarray - 1)
mvwprintw(w_bar_b, 0, x, "%s", ptarray[current]->name); mvwprintw(w_bar_b, 0, x, "%s", ptarray[current]->name);
level = VSC_LevelDesc(verbosity);
if (level != NULL)
mvwprintw(w_bar_b, 0, X - 7, "%7s", level->label);
X -= 7;
if (!hide_unseen)
mvwprintw(w_bar_b, 0, X - 6, "%6s", "UNSEEN");
wnoutrefresh(w_bar_b); wnoutrefresh(w_bar_b);
} }
...@@ -801,6 +813,12 @@ handle_keypress(int ch) ...@@ -801,6 +813,12 @@ handle_keypress(int ch)
hide_unseen = 1 - hide_unseen; hide_unseen = 1 - hide_unseen;
rebuild = 1; rebuild = 1;
break; break;
case 'v':
verbosity++;
if (VSC_LevelDesc(verbosity) == NULL)
verbosity = 0;
rebuild = 1;
break;
case 'q': case 'q':
case 'Q': case 'Q':
keep_running = 0; keep_running = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment