Add per-resource history and guest network groups

This commit is contained in:
Maxim
2026-08-01 12:43:05 +03:00
parent d3fbbf2a6b
commit 92607f62d5
6 changed files with 202 additions and 18 deletions

View File

@@ -29,3 +29,17 @@ func TestStoreSettingsAndHistory(t *testing.T) {
t.Fatalf("история не сохранилась: points=%+v err=%v", points, err)
}
}
func TestEntityHistory(t *testing.T) {
store, err := openStore(":memory:")
if err != nil {
t.Fatal(err)
}
defer store.Close()
value := 42.5
store.AddEntityHistory("zfs", "rpool", time.Now().Unix(), &value, nil)
series, err := store.EntityHistory("zfs", 24)
if err != nil || len(series) != 1 || len(series[0].Points) != 1 || series[0].Name != "rpool" {
t.Fatalf("unexpected entity history: %+v %v", series, err)
}
}