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

lan-bps chart #298

Closed
sfs-pra opened this issue Dec 29, 2024 · 7 comments
Closed

lan-bps chart #298

sfs-pra opened this issue Dec 29, 2024 · 7 comments

Comments

@sfs-pra
Copy link
Contributor

sfs-pra commented Dec 29, 2024

I want to change the lan-bps.widget “label” to “chart”.
What is 100% ?
If you take as 100% ip link show eth0 |head -n1|awk -F qlen '{print $2}' - the chart will be at zero all the time
You could take the number of bits per minute as 100%. I don't understand how to get it in widget

@LBCrion
Copy link
Owner

LBCrion commented Dec 29, 2024 via email

@sfs-pra
Copy link
Contributor Author

sfs-pra commented Dec 29, 2024

Possibly the most reasonable graph you can plot is the current tx rate vs max recorded tx rate for the session. It would be a bit fiddly to implement, but should be possible.

Set EthRcvdMax1 = If(EthRcvd1 >= EthRcvdMax1, EthRcvd1, EthRcvdMax1)
lan-chart.widget.gz
Рroblems :
When “rcvd” is changed to “sent” - the whole chart is recolored

@Consolatis
Copy link
Contributor

Consolatis commented Dec 30, 2024

For another implementation I've gone with a default min cap of 50 kb/s and otherwise max bw for the values represented in the history to mean 100%. The min cap ensures that values like 0.5 kb/s don't show up as 100% if there is otherwise no noticeable network traffic. So essentially something like max_bw = max(50*1024, max(history_values)).

@LBCrion
Copy link
Owner

LBCrion commented Dec 30, 2024

How about this?

file("/proc/net/dev") {
  EthRcvd = RegEx("^(?!.*lo).*:[\t ]*([0-9]+)",Sum)
}

Set LanBPS = (EthRcvd-EthRcvd.pval)/0.001024/EthRcvd.time
Set LanMax = Max(Max(50, Cached(LanMax)), LanBPS)

layout {
  chart {
    style = "cpu_chart"
    interval = 1000
    value = LanBPS/LanMax
  }
}

@sfs-pra
Copy link
Contributor Author

sfs-pra commented Dec 31, 2024

How about this?

perfectly

EthRcvd = RegEx("^(?!.lo).:[\t ]*([0-9]+)",Sum)

And if two interfaces eth0 wlan0 ?

@LBCrion
Copy link
Owner

LBCrion commented Dec 31, 2024 via email

@sfs-pra
Copy link
Contributor Author

sfs-pra commented Dec 31, 2024

lan-chart.widget.gz

When “rcvd” is changed to “sent” - the whole chart is recolored

Here either draw 2*chart or wait for a chart with two charts to appear :)

@sfs-pra sfs-pra closed this as completed Dec 31, 2024
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

No branches or pull requests

3 participants