diff options
| author | Jeff Carr <[email protected]> | 2024-01-06 05:24:11 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-06 05:24:11 -0600 |
| commit | 3457aefa86ccc9bc6c4eda059e48ebcb8830b410 (patch) | |
| tree | 525dca4d9ec74d26282521148cd4918d85081e9b /linuxstatus/update.go | |
| parent | d2fb88cd584b8e7e60cb6315d9fb8d0d6ceac22f (diff) | |
add LinuxStatus()
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'linuxstatus/update.go')
| -rw-r--r-- | linuxstatus/update.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/linuxstatus/update.go b/linuxstatus/update.go new file mode 100644 index 0000000..1ab8cee --- /dev/null +++ b/linuxstatus/update.go @@ -0,0 +1,31 @@ +package linuxstatus + +import ( + "errors" + "fmt" + "time" + + "go.wit.com/log" +) + +func (ls *LinuxStatus) Update() { + log.Info("linuxStatus() Update() START") + if ls == nil { + log.Error(errors.New("linuxStatus() Update() ls == nil")) + return + } + duration := timeFunction(func () { + linuxLoop() + }) + s := fmt.Sprint(duration) + ls.speedActual.Set(s) + + if (duration > 500 * time.Millisecond ) { + // ls.speed, "SLOW") + } else if (duration > 100 * time.Millisecond ) { + // ls.speed, "OK") + } else { + // ls.speed, "FAST") + } + log.Info("linuxStatus() Update() END") +} |
