Traffic widget measurement issue #417
MahinHossainMunna
started this conversation in
Ideas
Replies: 1 comment
-
That's why you have the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Yasb bar traffic meter shows double of the actual value. I have to change this issue by the help of ChatGPT.
here is the fix:
traffic:
type: "yasb.script.ScriptWidget"
options:
label: "\udb81\udf2e {download}{upload} \udb81\udf37"
update_interval: 1000
command: >
powershell -NoProfile -Command "& {
$iface = (Get-NetAdapter | Where-Object Status -eq Up | Select-Object -First 1 -ExpandProperty Name);
$stats1 = Get-NetAdapterStatistics -Name $iface;
Start-Sleep -Milliseconds 1000;
$stats2 = Get-NetAdapterStatistics -Name $iface;
$rxBps = ($stats2.ReceivedBytes - $stats1.ReceivedBytes);
$txBps = ($stats2.SentBytes - $stats1.SentBytes);
$rxMbps = [math]::Round(($rxBps * 8 / 1MB), 2);
$txMbps = [math]::Round(($txBps * 8 / 1MB), 2);
Write-Output "{ 'download': '$rxMbps Mbps', 'upload': '$txMbps Mbps' }";
}"
container_padding:
top: 0
left: 0
bottom: 0
right: 0
label_shadow:
enabled: false
color: "black"
radius: 5
offset: [0, 0]
Beta Was this translation helpful? Give feedback.
All reactions