[master] 948681c6b In curses mode, always filter in the counters necessary for the header lines.

Poul-Henning Kamp phk at FreeBSD.org
Mon Aug 13 09:16:07 UTC 2018


commit 948681c6b9acb350aed7766283d63d69c35ee393
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Aug 13 09:14:52 2018 +0000

    In curses mode, always filter in the counters necessary for the
    header lines.
    
    Fixes:  #2678

diff --git a/bin/varnishstat/varnishstat.c b/bin/varnishstat/varnishstat.c
index 0a78a4513..74a8f5adf 100644
--- a/bin/varnishstat/varnishstat.c
+++ b/bin/varnishstat/varnishstat.c
@@ -264,6 +264,7 @@ main(int argc, char * const *argv)
 	int once = 0, xml = 0, json = 0, f_list = 0, curses = 0;
 	signed char opt;
 	int i;
+	int has_f = 0;
 	struct vsc *vsc;
 
 	vut = VUT_InitProg(argc, argv, &vopt_spec);
@@ -293,6 +294,7 @@ main(int argc, char * const *argv)
 			break;
 		case 'f':
 			AN(VSC_Arg(vsc, opt, optarg));
+			has_f = 1;
 			break;
 		case 'V':
 			AN(VUT_Arg(vut, opt, optarg));
@@ -315,8 +317,15 @@ main(int argc, char * const *argv)
 	if (VSM_Attach(vd, STDERR_FILENO))
 		VUT_Error(vut, 1, "%s", VSM_Error(vd));
 
-	if (curses)
+	if (curses) {
+		if (has_f) {
+			AZ(VSC_Arg(vsc, 'f', "MGT.uptime"));
+			AZ(VSC_Arg(vsc, 'f', "MAIN.uptime"));
+			AZ(VSC_Arg(vsc, 'f', "MAIN.cache_hit"));
+			AZ(VSC_Arg(vsc, 'f', "MAIN.cache_miss"));
+		}
 		do_curses(vd, vsc, 1.0);
+	}
 	else if (xml)
 		do_xml(vd, vsc);
 	else if (json)


More information about the varnish-commit mailing list