SCCS-vsn: usr.bin/systat/iostat.c 1.2
-static char sccsid[] = "@(#)iostat.c 1.1 (Lucasfilm) %G%";
+static char sccsid[] = "@(#)iostat.c 1.2 (Lucasfilm) %G%";
static WINDOW *w = NULL;
if (w == NULL)
static WINDOW *w = NULL;
if (w == NULL)
- w = newwin(20, 70, 3, 5);
+ w = newwin(20, 70, 4, 5);
+ move(row, 0); clrtoeol();
+ mvaddstr(row++, 10,
+ "/0 /10 /20 /30 /40 /50 /60 /70 /80 /90 /100");
mvaddstr(row++, 0, "cpu user|"); clrtoeol();
mvaddstr(row++, 0, " nice|"); clrtoeol();
mvaddstr(row++, 0, " system|"); clrtoeol();
mvaddstr(row++, 0, "cpu user|"); clrtoeol();
mvaddstr(row++, 0, " nice|"); clrtoeol();
mvaddstr(row++, 0, " system|"); clrtoeol();
itime += xtime, xtime = 0;
if (itime < 0)
xtime += itime, itime = 0;
itime += xtime, xtime = 0;
if (itime < 0)
xtime += itime, itime = 0;
- wmove(wnd, row++, 5); histogram(words / 512 / etime, 60, 'X');
- wmove(wnd, row++, 5); histogram(s.dk_xfer[dn] / etime, 60, 'X');
+ wmove(wnd, row++, 5); histogram(words / 512 / etime, 60, 1.0, 'X');
+ wmove(wnd, row++, 5); histogram(s.dk_xfer[dn] / etime, 60, 1.0, 'X');
wmove(wnd, row++, 5); histogram(s.dk_seek[dn] ?
wmove(wnd, row++, 5); histogram(s.dk_seek[dn] ?
- itime * 1000. / s.dk_seek[dn] : 0, 60, 'X');
+ itime * 1000. / s.dk_seek[dn] : 0, 60, 1.0, 'X');
time += s.cp_time[i];
if (time == 0.0)
time = 1.0;
time += s.cp_time[i];
if (time == 0.0)
time = 1.0;
- wmove(wnd, row, 5); histogram(100*s.cp_time[o] / time, 60, 'X');
+ wmove(wnd, row, 5); histogram(100*s.cp_time[o] / time, 60, 0.5, 'X');
-histogram(val, colwidth, c)
+histogram(val, colwidth, scale, c)
double val;
int colwidth;
double val;
int colwidth;
char c;
{
char buf[10];
register int k;
char c;
{
char buf[10];
register int k;
- register int v = (int)(val + 0.5);
+ register int v = (int)(val * scale) + 0.5;
k = MIN(v, colwidth);
if (v > colwidth) {
k = MIN(v, colwidth);
if (v > colwidth) {
- sprintf(buf, " %d", v);
+ sprintf(buf, "%4.1f", v);
k -= strlen(buf);
while (k--)
waddch(wnd, c);
k -= strlen(buf);
while (k--)
waddch(wnd, c);