Skip to content

Commit be745d9

Browse files
committed
Fix minor bugs identified by CI
1 parent fcd0f1d commit be745d9

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
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
@@ -344,7 +344,7 @@ func New(options *Options) *API {
344344
r.Use(
345345
apiKeyMiddleware,
346346
)
347-
r.Get("/daus", api.getDAUs)
347+
r.Get("/daus", api.daus)
348348
})
349349
})
350350
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 {

0 commit comments

Comments
 (0)