Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add system wide network protocol stats #109

Merged
merged 1 commit into from
Nov 21, 2015
Merged

Conversation

nathanielc
Copy link
Contributor

A new method NetProtoCounters has been added that returns a list of NetProtoCountersStat objects.
A map is used in NetProtoCountersStat since the stat names are different per protocol.

Typical contents of /proc/net/snmp
The file contains system wide counters about different network protocols.

Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates
Ip: 1 64 145831951 0 4 420174 0 0 145410079 138817441 3718096 285 0 0 0 0 0 0 0
Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens AttemptFails EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs OutRsts InCsumErrors
Tcp: 1 200 120000 -1 441395 303349 29634 9431 66 14558102 12577486 14364 676 53622 0
Udp: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors IgnoredMulti
Udp: 67688650 3723361 58108572 124599763 58108572 0 0 318767

Only linux support has been added. Other OSes have been give an implementation that returns a not implemented error.

Fixes #108

@sparrc
Copy link
Contributor

sparrc commented Nov 19, 2015

This would be great! 👍

@shirou
Copy link
Owner

shirou commented Nov 20, 2015

Awesome!! Thank you very much for this beautiful contribution.

It looks so good to me but I want one thing.
Could you add something to README? (My English is poor to represent your work.)

@nathanielc
Copy link
Contributor Author

@shirou Updated README... thanks for looking at this so quickly

shirou added a commit that referenced this pull request Nov 21, 2015
Add system wide network protocol stats
@shirou shirou merged commit 4e774ea into shirou:master Nov 21, 2015
@shirou
Copy link
Owner

shirou commented Nov 21, 2015

Thank you very much!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants