Skip to content

Commit ebf974d

Browse files
committed
push startup script metrics to agent
1 parent 7ebe6bd commit ebf974d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

agent/agent.go

+5
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,11 @@ func (a *agent) startReportingConnectionStats(ctx context.Context) {
12031203
stats.TxPackets += int64(counts.TxPackets)
12041204
}
12051205

1206+
// Load the latest startup script stats. These stats are static
1207+
// once the agent has started.
1208+
stats.StartupScriptNs = a.stats.startScriptNs.Load()
1209+
stats.StartupScriptSuccess = a.stats.startScriptSuccess.Load()
1210+
12061211
// The count of active sessions.
12071212
sshStats := a.sshServer.ConnStats()
12081213
stats.SessionCountSSH = sshStats.Sessions

codersdk/agentsdk/agentsdk.go

-1
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,6 @@ type Stats struct {
575575
// that are normal, non-tagged SSH sessions.
576576
SessionCountSSH int64 `json:"session_count_ssh"`
577577

578-
// Script stats relate to all scripts executed by the agent.
579578
// StartupScriptNs is the duration in nano seconds the startup scripts
580579
// took to execute. If there are no scripts, this still has some value > 0.
581580
// This is because the act of "no script" still takes time to eval, and still

0 commit comments

Comments
 (0)