""
This commit is contained in:
7
iftop.8
7
iftop.8
@@ -26,10 +26,11 @@ if none is specified, and displays a table of current bandwidth usage by pairs
|
||||
of hosts.
|
||||
|
||||
When run, \fBiftop\fP displays, for each pair of hosts, the rate at which data
|
||||
is sent and received averaged over 3, 15 and 60 second intervals. The direction
|
||||
is sent and received averaged over 1, 5 and 20 second intervals. The direction
|
||||
of data flow is indicated by arrows, <= and =>. In addition, a simple bar graph
|
||||
shows the 15-second average. The pairs of hosts which consume the most bandwidth
|
||||
are displayed at the top of the screen.
|
||||
shows the 5-second average. The pairs of hosts which consume the most bandwidth
|
||||
are displayed at the top of the screen, and totals for all hosts are shown at
|
||||
the bottom of the screen.
|
||||
|
||||
By default, \fBiftop\fP will look up the hostnames associated with addresses it
|
||||
finds in packets. This can cause substantial traffic of itself, and may result
|
||||
|
||||
@@ -55,8 +55,6 @@ void resolver_worker(void* ptr) {
|
||||
|
||||
pthread_mutex_unlock(&resolver_queue_mutex);
|
||||
|
||||
|
||||
|
||||
hstbuflen = 1024;
|
||||
/* Allocate buffer, remember to free it to avoid memory leakage. */
|
||||
tmphstbuf = xmalloc (hstbuflen);
|
||||
@@ -69,7 +67,6 @@ void resolver_worker(void* ptr) {
|
||||
tmphstbuf = realloc (tmphstbuf, hstbuflen);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Store the result in ns_hash
|
||||
*/
|
||||
|
||||
9
ui.c
9
ui.c
@@ -18,9 +18,10 @@
|
||||
|
||||
#define HOSTNAME_LENGTH 256
|
||||
|
||||
#define HISTORY_DIVISIONS 3
|
||||
#define HISTORY_DIVISIONS 3
|
||||
#define BARGRAPH_INTERVAL 1 /* which division used for bars. */
|
||||
|
||||
/* 3, 15 and 60 seconds */
|
||||
/* 1, 15 and 60 seconds */
|
||||
int history_divs[HISTORY_DIVISIONS] = {1, 5, 20};
|
||||
|
||||
|
||||
@@ -240,12 +241,12 @@ void ui_print() {
|
||||
|
||||
/* Do some sort of primitive bar graph thing. */
|
||||
mvchgat(y, 0, -1, A_NORMAL, 0, NULL);
|
||||
L = get_bar_length(8 * screen_line->sent[0] / history_divs[0]);
|
||||
L = get_bar_length(8 * screen_line->sent[BARGRAPH_INTERVAL] / history_divs[BARGRAPH_INTERVAL]);
|
||||
if (L > 0)
|
||||
mvchgat(y, 0, L, A_REVERSE, 0, NULL);
|
||||
|
||||
mvchgat(y+1, 0, -1, A_NORMAL, 0, NULL);
|
||||
L = get_bar_length(8 * screen_line->recv[0] / history_divs[0]);
|
||||
L = get_bar_length(8 * screen_line->recv[BARGRAPH_INTERVAL] / history_divs[BARGRAPH_INTERVAL]);
|
||||
if (L > 0)
|
||||
mvchgat(y+1, 0, L, A_REVERSE, 0, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user