Commit 0efdb5c8 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

Remove arbitrary 1.0 threshold in varnishtop -1

With that both -d and -1 options report the same output, with the former
limited to the terminal height. While this increases the risk of "never
ending" dumps of log records showing only once, the assumption is that
varnishtop is useful when someone is looking for something in particular.
Restricting the output to the records someone is interested in mitigates
the risk.

Fixes #2686
parent d1b78e8d
varnishtest "varnishtop -1/-d"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend { } -start
client c1 {
txreq
rxresp
} -run
process p1 -dump {varnishtop -n ${v1_name} -d -i ReqMethod} -start
process p1 -winsz 30 80
delay 2
process p1 -expect-text 1 1 "list length 1"
process p1 -expect-text 1 75 "(EOF)"
process p1 -expect-text 3 6 "1.00 ReqMethod GET"
process p1 -screen_dump -wait
process p2 -dump {varnishtop -n ${v1_name} -1 -i ReqMethod} -start
process p2 -winsz 30 80
delay 2
process p2 -expect-text 1 6 "1.00 ReqMethod GET"
process p2 -screen_dump -wait
......@@ -322,8 +322,6 @@ dump(void)
struct top *tp, *tp2;
for (tp = VRB_MIN(t_order, &h_order); tp != NULL; tp = tp2) {
tp2 = VRB_NEXT(t_order, &h_order, tp);
if (tp->count <= 1.0)
break;
printf("%9.2f %s %*.*s\n",
tp->count, VSL_tags[tp->tag],
tp->clen, tp->clen, tp->rec_data);
......
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