DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T d

⟦eb1b8a581⟧ TextFile

    Length: 2057 (0x809)
    Types: TextFile
    Names: »display.c«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦this⟧ »EUUGD11/euug-87hel/sec8/mon/display.c« 

TextFile

/*
 *			D I S P L A Y . C
 *
 *  This section handles the display initialization and updates for "mon"
 */
#include "mon.h"
#include <curses.h>

#define	HOSTLEN	40		/* Length of hostname */

/* Screen Positions */
#define	LEFT	0
#define	PROCY	2
#define	CPUY	5
#define	TIMEY	8
#define	PAGEY	11
#define	CHARY	5
#define	CHARX	37
#define	NETIFY	17
#define	DISKY	2
#define	DISKX	55

/*
 * DISPINIT - clears the screen, puts up the info labels, and
 *   displays the initial information (device names).
 */
dispinit()
{
	char	hname[HOSTLEN];
	register int i;

	clear();			/* clear screen */
	gethostname(hname, HOSTLEN);	/* host name in upper left */
	printw(hname);

	/* Put up the labels */
        mvprintw(PROCY,LEFT,"Procs: r d p s sl  Mem: real  ract  virt  vact  free");
        mvprintw(DISKY,DISKX,"Disks: Kbps tps msps");
        mvprintw(CPUY,LEFT,"Cpu: ints  scall  csw");
	if (dualcpu)
	        mvprintw(CPUY,LEFT+25,"Cpu2: csw");
        mvprintw(TIMEY,LEFT,"Time: user nice sys idle");
	if (dualcpu)
	        mvprintw(TIMEY,LEFT+26,"Time2: user nice sys idle");
        mvprintw(PAGEY,LEFT,"Paging: re  at pin pout  oprs  fr  def   sr");
	mvprintw(PAGEY+3,LEFT,"       nxf  xf  nzf  zf  nrf  rf  prf  swi swo");
        mvprintw(CHARY,CHARX,"Char: in   out");
        mvprintw(NETIFY,LEFT,"Name   Ipkts  Ierrs  Opkts  Oerrs  Collis Oqueue");

	/* add the disk drive names to the screen */
        for(i = 0; i < DK_NDRIVE; i++) {
		if (*dr_name[i])
	                mvprintw(DISKY+1+i,DISKX,dr_name[i]);
		else
			break;
        }
	mvprintw(DISKY+1+i,DISKX,"--------------------");
	mvprintw(DISKY+2+i,DISKX,"Total:");

	/* put up the network interface names */
	for (i = 0; i < numif; i++)
		mvprintw(NETIFY+1+i,LEFT,nifinfo[i].name);
}

/*
 * DISPUPDATE - updates the dynamic data on the screen.
 */
dispupdate()
{
	int	i;

	for (i = 0; i < numif; i++)
		mvprintw(NETIFY+1+i,LEFT+7,"%5d  %5d  %5d  %5d  %5d  %5d",
			nifdat[i].ipackets, nifdat[i].ierrors,
			nifdat[i].opackets, nifdat[i].oerrors,
			nifdat[i].collisions, nifinfo[i].outqlen);
}