Closed ldir-EDB0 closed 4 years ago
Kevin Darbyshire-Bryant notifications@github.com writes:
Hi All,
A question more than a problem: Is there a way to produce a rate of traffic type stat per tin? I know I can get 'bytes sent per tin' out of tc -s but that doesn't directly tell me how much data has gone through a tin since the last sample.
I did a quick & dirty 'subtract last value from current value' type display but I'm wondering if there's something more elegant possible within the existing tin variables.?
Nah, rate is just 'bytes over time', so subtracting works fine. There are a couple of optimisations you can do to get more precise polling, such as not spawning a new TC process every time[0], and using timerfds. See https://github.com/tohojo/flent/blob/master/misc/tc_iterate.c for an example.
[0] This may be broken in newer tc versions, actually, don't quite recall.
Excellent, thanks for the pointer :-)
the tc_iterate.c tc -b - mode got broken a year or two back. There's a github thread somewhere trying to fix it.
Kevin Darbyshire-Bryant notifications@github.com writes:
Excellent, thanks for the pointer :-)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Hi All,
A question more than a problem: Is there a way to produce a rate of traffic type stat per tin? I know I can get 'bytes sent per tin' out of tc -s but that doesn't directly tell me how much data has gone through a tin since the last sample.
I did a quick & dirty 'subtract last value from current value' type display but I'm wondering if there's something more elegant possible within the existing tin variables.?