I was using SAR for monitoring bandwidth in one of my projects and I was not sure if it is reporting correct data. So I wrote a very simple dummy program (in java) for testing it which opens a server socket, opens a client connection to that server socket. The server socket upon accepting that client connection, starts writing bytebuffer (of size 1) in a while(true) loop with 1 sec sleep between each iteration. Ideally, I would expect 1 byte transfer every second on the loopback interface in the "SAR -n DEV 1 100" output but what I see is following:
10:54:53 IFACE Ipkts/s Ibytes/s Opkts/s Obytes/s
10:54:56 lo0 2 113 2 113
10:54:56 gif0 0 0 0 0
10:54:56 stf0 0 0 0 0
10:54:56 en0 0 0 0 0
10:54:56 en1 0 0 0 0
10:54:56 fw0 0 0 0 0
10:54:56 vmnet1 0 0 0 0
10:54:56 vmnet8 0 0 0 0
Anyone who can explain this output ?
thanks, sandeep