mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: remove InsertWorkspaceAgentStat query (#12869)
* chore: remove InsertWorkspaceAgentStat query InsertWorkspaceAgentStats (batch) exists. We only used the singular in a single unit test place. Removing the single for the batch, reducing the interface size.
This commit is contained in:
@@ -3,6 +3,7 @@ package metricscache_test
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -280,14 +281,25 @@ func TestCache_DeploymentStats(t *testing.T) {
|
||||
})
|
||||
defer cache.Close()
|
||||
|
||||
_, err := db.InsertWorkspaceAgentStat(context.Background(), database.InsertWorkspaceAgentStatParams{
|
||||
ID: uuid.New(),
|
||||
AgentID: uuid.New(),
|
||||
CreatedAt: dbtime.Now(),
|
||||
ConnectionCount: 1,
|
||||
RxBytes: 1,
|
||||
TxBytes: 1,
|
||||
SessionCountVSCode: 1,
|
||||
err := db.InsertWorkspaceAgentStats(context.Background(), database.InsertWorkspaceAgentStatsParams{
|
||||
ID: []uuid.UUID{uuid.New()},
|
||||
CreatedAt: []time.Time{dbtime.Now()},
|
||||
WorkspaceID: []uuid.UUID{uuid.New()},
|
||||
UserID: []uuid.UUID{uuid.New()},
|
||||
TemplateID: []uuid.UUID{uuid.New()},
|
||||
AgentID: []uuid.UUID{uuid.New()},
|
||||
ConnectionsByProto: json.RawMessage(`[{}]`),
|
||||
|
||||
RxPackets: []int64{0},
|
||||
RxBytes: []int64{1},
|
||||
TxPackets: []int64{0},
|
||||
TxBytes: []int64{1},
|
||||
ConnectionCount: []int64{1},
|
||||
SessionCountVSCode: []int64{1},
|
||||
SessionCountJetBrains: []int64{0},
|
||||
SessionCountReconnectingPTY: []int64{0},
|
||||
SessionCountSSH: []int64{0},
|
||||
ConnectionMedianLatencyMS: []float64{10},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user