Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
2f9bc1ba23
commit
e91f68a3bf
1 file changed
-33
@@ -1,33 +0,0 @@
|
||||
//go:build liverender
|
||||
|
||||
package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gitea.mynodes.xyz/ilker/llmgw/internal/control/adminapi"
|
||||
"gitea.mynodes.xyz/ilker/llmgw/internal/promq"
|
||||
)
|
||||
|
||||
func TestLiveRender(t *testing.T) {
|
||||
p := promq.New("http://10.0.0.146:9090", 10*time.Second)
|
||||
m := newConsoleModel("127.0.0.1:1", "/nonexistent")
|
||||
m.loaded, m.menu, m.inPanel, m.width, m.height = true, cMonitor, true, 170, 70
|
||||
m.mon.rng = 1
|
||||
step, qs := monitorQueries(time.Hour, (m.monitorWidth()/2-2)*2)
|
||||
res := adminapi.MetricsResult{Configured: true, Series: map[string][]promq.Series{}}
|
||||
for _, q := range qs {
|
||||
s, err := p.RangeQuery(context.Background(), q.Expr, q.By, time.Hour, step)
|
||||
if err != nil {
|
||||
t.Logf("%s: %v", q.ID, err)
|
||||
}
|
||||
res.Series[q.ID] = s
|
||||
}
|
||||
m.mon.res = res
|
||||
m.mon.key = m.monitorKey()
|
||||
_, body, _ := m.monitorPanel(m.monitorWidth())
|
||||
fmt.Println(body)
|
||||
}
|
||||
Reference in new issue
Block a user