Commit b0a2afed authored by Lasse Karstensen's avatar Lasse Karstensen Committed by Dridi Boukelmoune

Make it possible to change ncurses update rate.

This is a squashed commit including lint removal and formatting
suggested by @nigoroll.
parent 0fdc2c9f
......@@ -324,7 +324,7 @@ main(int argc, char * const *argv)
AN(VSC_Arg(vsc, 'f', "MAIN.cache_hit"));
AN(VSC_Arg(vsc, 'f', "MAIN.cache_miss"));
}
do_curses(vd, vsc, 1.0);
do_curses(vd, vsc);
}
else if (xml)
do_xml(vd, vsc);
......
......@@ -35,4 +35,4 @@
#include "vas.h"
#include "vcs.h"
void do_curses(struct vsm *, struct vsc *, double);
void do_curses(struct vsm *, struct vsc *);
......@@ -435,6 +435,8 @@ draw_status(void)
mvwprintw(w_status, 1, 0, "Uptime child: ");
running(w_status, up_chld, VSM_WRK_RUNNING);
mvwprintw(w_status, 0, 55, "Refresh interval: %.3fs", interval);
if (COLS > 70) {
mvwprintw(w_status, 0, getmaxx(w_status) - 37,
"Hitrate n: %8u %8u %8u", hitrate.hr_10.n, hitrate.hr_100.n,
......@@ -899,6 +901,14 @@ handle_keypress(int ch)
current = n_ptarray - 1;
page_start = (current - l_points) + 1;
break;
case '+':
interval += 0.1;
break;
case '-':
interval -= 0.1;
if (interval < 0.1)
interval = 0.1;
break;
case 'v':
verbosity = VSC_ChangeLevel(verbosity, 1);
rebuild = 1;
......@@ -980,14 +990,12 @@ delpt(void *priv, const struct VSC_point *const vpt)
}
void
do_curses(struct vsm *vsm, struct vsc *vsc, double delay)
do_curses(struct vsm *vsm, struct vsc *vsc)
{
long t;
int ch;
double now;
interval = delay;
verbosity = VSC_ChangeLevel(NULL, 0);
initscr();
......
......@@ -109,6 +109,13 @@ The following keys control the interactive display:
<CTRL+T>
Sample now.
<+>
Increase refresh interval.
<->
Decrease refresh interval.
OUTPUTS
=======
......
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