loadavg: Split the collector for linux and other platforms.
This commit is contained in:
parent
720198e047
commit
d80b2af492
3 changed files with 81 additions and 1 deletions
14
collector/loadavg_linux_test.go
Normal file
14
collector/loadavg_linux_test.go
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package collector
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestLoad(t *testing.T) {
|
||||
load, err := parseLoad("0.21 0.37 0.39 1/719 19737")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if want := 0.21; want != load {
|
||||
t.Fatalf("want load %f, got %f", want, load)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue