mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
fix: handle new agent stat format correctly (#14576)
--------- Co-authored-by: Ethan Dickson <ethan@coder.com>
This commit is contained in:
@ -32,7 +32,7 @@ func TestCache_TemplateWorkspaceOwners(t *testing.T) {
|
||||
db = dbmem.New()
|
||||
cache = metricscache.New(db, slogtest.Make(t, nil), metricscache.Intervals{
|
||||
TemplateBuildTimes: testutil.IntervalFast,
|
||||
})
|
||||
}, false)
|
||||
)
|
||||
|
||||
defer cache.Close()
|
||||
@ -150,7 +150,7 @@ func TestCache_BuildTime(t *testing.T) {
|
||||
},
|
||||
},
|
||||
transition: database.WorkspaceTransitionStop,
|
||||
}, want{50 * 1000, true},
|
||||
}, want{30 * 1000, true},
|
||||
},
|
||||
{
|
||||
"three/delete", args{
|
||||
@ -183,7 +183,7 @@ func TestCache_BuildTime(t *testing.T) {
|
||||
db = dbmem.New()
|
||||
cache = metricscache.New(db, slogtest.Make(t, nil), metricscache.Intervals{
|
||||
TemplateBuildTimes: testutil.IntervalFast,
|
||||
})
|
||||
}, false)
|
||||
)
|
||||
|
||||
defer cache.Close()
|
||||
@ -278,7 +278,7 @@ func TestCache_DeploymentStats(t *testing.T) {
|
||||
db := dbmem.New()
|
||||
cache := metricscache.New(db, slogtest.Make(t, nil), metricscache.Intervals{
|
||||
DeploymentStats: testutil.IntervalFast,
|
||||
})
|
||||
}, false)
|
||||
defer cache.Close()
|
||||
|
||||
err := db.InsertWorkspaceAgentStats(context.Background(), database.InsertWorkspaceAgentStatsParams{
|
||||
@ -300,6 +300,7 @@ func TestCache_DeploymentStats(t *testing.T) {
|
||||
SessionCountReconnectingPTY: []int64{0},
|
||||
SessionCountSSH: []int64{0},
|
||||
ConnectionMedianLatencyMS: []float64{10},
|
||||
Usage: []bool{false},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
|
Reference in New Issue
Block a user