Example #1
0
func TestGetLoad(t *testing.T) {
	have := host.GetLoad()
	if strings.Contains(have, "unknown") {
		t.Fatal(have)
	}
	t.Log(have)
}
Example #2
0
func TestGetLoad(t *testing.T) {
	have := host.GetLoad(time.Now())
	if len(have) != 3 {
		t.Fatalf("Expected 3 metrics, but got: %v", have)
	}
	for key, metric := range have {
		if metric.Len() != 1 {
			t.Errorf("Expected metric %v to have 1 sample, but had: %d", key, metric.Len())
		}
	}
}