You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System restart changes the length of output and seems to have caused some issues in at least one reported case.
In addition, it occurred to me that three separate calls to uptime were itself problematic for two reasons:
1) The load values for all three measurements would change with each call, even though we were only looking at one of the values each time, it isn't consistent with the broader idea of acting on what the measurements are at a specific moment in time
2) We are responding to load, making three separate calls to uptime and awk just contributes to more of it (however minuscule)
Considering all of the above, I've changed it so we grab the values for load1, load5 and load15 from /proc/loadavg in one pass. This avoids any issue with variable output length from uptime and makes it a single lighter-weight query that represents a snapshot from a single moment in time.
My apologies for the belated update, @ctgreybeard posted an issue but I was not @ mentioned and never saw it. I was just scrolling through ages-old contributions and other code and happened to see it just now. But hey, what's 10 years between friends?!
resolvestodbot#30
I discovered that the uptime message is variable length depending on how long it has been since a system restart. My current uptime reads:
23:09pm up 2:04, 3 users, load average: 0.66, 0.56, 0.47
which causes load-to-blink1.sh to fail.
I have a fix almost ready, it's a simple fix.
I need to clean up my git clone before I can submit it.
Please assign this to me.
The text was updated successfully, but these errors were encountered: