Change project layout to make easier debug / tests"

This commit is contained in:
eleksir
2024-09-22 23:52:57 +03:00
parent 9d3bc186cc
commit 4bff21f4c7
112 changed files with 271 additions and 1683 deletions

24
internal/lib/la.go Normal file
View File

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