Add persistent thresholds and seven-day metrics history
This commit is contained in:
14
history_test.go
Normal file
14
history_test.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestHistoryPointFromMetrics(t *testing.T) {
|
||||
metrics := dashboardMetrics{
|
||||
CPU: CPUMetrics{Temperatures: []Temperature{{Celsius: 40}, {Celsius: 60}}},
|
||||
Guests: GuestsMetrics{Guests: []GuestMetrics{{Status: "running", CPU: .5, MaxCPU: 4, MemoryBytes: 50, MaxMemory: 100}}},
|
||||
}
|
||||
point := historyPointFromMetrics(metrics)
|
||||
if point.CPUTemperature != 50 || point.GuestsCPU != 50 || point.GuestsMemory != 50 {
|
||||
t.Fatalf("неожиданная историческая точка: %+v", point)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user