netdev
[Top] [All Lists]

Network statistics counters missing 'broadcasts'

To: Matti Aarnio <matti.aarnio@xxxxxxxxxxx>
Subject: Network statistics counters missing 'broadcasts'
From: Robert Olsson <Robert.Olsson@xxxxxxxxxxx>
Date: Wed, 3 Jan 2001 15:04:02 +0100 (CET)
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20010103155010.D12545@mea-ext.zmailer.org>
References: <20010103155010.D12545@mea-ext.zmailer.org>
Sender: owner-netdev@xxxxxxxxxxx
Matti Aarnio writes:
  > 
 > A generic network layer statistics thing is that there apparently is no 
 > counter for broadcasts, and thus usually multicasts and broadcasts do get
 > folded into the same counter.
 
 Hello!

 I may mention a little hack for average statistics and clearable stats
 in case anyone has need for it. It does not break ordinary device stats.

 ftp from:
 robur.slu.se:/pub/Linux/net-development/ends/ends.c


 Cheers.

                                                --ro



/ *

 In essential ENDS gives average statistics and clearable interface counters 
 for all open network devices.  The statistics is held in ends_device struct. 
 ENDS creates and maintains the /proc/net/stat directory.


 /proc/net/stats/ends_control              # Control various ends settings
 /proc/net/stats/<device name>             # For all open devices.

 Example:

 cat /proc/net/stats/eth0

 [Output lines are truncated]


Uptime Exceeds: 118c9   11 min 58 sec 
Last input:     0       NOW
Last output:    0       NOW
Counters age:   fe34    10 min 50 sec 
Scan Interval:  20 sec
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    
  eth0:  168565    1777    0    0    0     0          0         0   123231 
  eth0:    1156      10    0    0    0     0          0         0     1079 



 First stats-line holds counters since last cleared. Second statsline is 
 average statistics in unit/seconds.
 
 echo clear >  /proc/net/stats/eth0        # Clears eth0 counters (line 1 above)
 echo interval 30 >  /proc/net/stats/eth0  # 

 Output format is the same as in /proc/net/dev plus extra lines with meta
 information. 


 TODO: More flexible EWMA calulations.


*/

<Prev in Thread] Current Thread [Next in Thread>