Initial commit

This commit is contained in:
eleksir
2024-01-06 18:33:44 +03:00
commit d85dc5d5bb
657 changed files with 262300 additions and 0 deletions

27
la.go Normal file
View File

@@ -0,0 +1,27 @@
package main
import (
"fmt"
"time"
"github.com/shirou/gopsutil/load"
)
// La переменная, хранящая значение LA за последнюю минуту.
var La = "-1"
// UpdateLaStats вытаскивает показание LA за последнюю минуту.
func UpdateLaStats() {
for {
l, _ := load.Avg()
lav := fmt.Sprintf("%.2f", l.Load1)
if La != lav {
La = lav
UpdateReady <- true
}
time.Sleep(3 * time.Second)
}
}