Skip to content

Commit 3b55d4b

Browse files
committed
Fix minor bugs identified by CI
1 parent 312ac8b commit 3b55d4b

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

agent/stats_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestConnStats(t *testing.T) {
2020
c1, c2 := net.Pipe()
2121

2222
payload := []byte("dogs & cats")
23-
statsConn := &agent.ConnStats{Conn: c1}
23+
statsConn := &agent.ConnStats{Conn: c1, ProtocolStats: &agent.ProtocolStats{}}
2424

2525
got := make(chan []byte)
2626
go func() {
@@ -44,7 +44,7 @@ func TestConnStats(t *testing.T) {
4444
c1, c2 := net.Pipe()
4545

4646
payload := []byte("cats & dogs")
47-
statsConn := &agent.ConnStats{Conn: c1}
47+
statsConn := &agent.ConnStats{Conn: c1, ProtocolStats: &agent.ProtocolStats{}}
4848

4949
go func() {
5050
c2.Write(payload)

coderd/coderd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ func New(options *Options) *API {
342342
r.Use(
343343
apiKeyMiddleware,
344344
)
345-
r.Get("/daus", api.getDAUs)
345+
r.Get("/daus", api.daus)
346346
})
347347
})
348348
r.Route("/workspaceagents", func(r chi.Router) {

coderd/metrics.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
const AgentStatIntervalEnv = "CODER_AGENT_STAT_INTERVAL"
2323

24-
func (api *API) getDAUs(rw http.ResponseWriter, r *http.Request) {
24+
func (api *API) daus(rw http.ResponseWriter, r *http.Request) {
2525
if !api.Authorize(r, rbac.ActionRead, rbac.ResourceMetrics) {
2626
httpapi.Forbidden(rw)
2727
return

codersdk/metrics.go

+2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ func (c *Client) GetDAUsFromAgentStats(ctx context.Context) (*GetDAUsResponse, e
130130
return &resp, json.NewDecoder(res.Body).Decode(&resp)
131131
}
132132

133+
// @typescript-ignore AgentStatsReportRequest
134+
133135
// AgentStatsReportRequest is a WebSocket request by coderd
134136
// to the agent for stats.
135137
type AgentStatsReportRequest struct {

site/src/api/typesGenerated.ts

-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ export interface AgentGitSSHKey {
2929
readonly private_key: string
3030
}
3131

32-
// From codersdk/metrics.go
33-
export interface AgentStatsReportRequest {}
34-
3532
// From codersdk/metrics.go
3633
export interface AgentStatsReportResponse {
3734
readonly num_comms: number

0 commit comments

Comments
 (0)