8000 fix(coderd): ensure agent timings are non-zero on insert by johnstcn · Pull Request #18065 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

fix(coderd): ensure agent timings are non-zero on insert #18065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 29, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
skip timings for agents that never connected
  • Loading branch information
johnstcn committed May 28, 2025
commit 6afbafe685c428e98286d4f27c4c3ae76e8ea632
8 changes: 8 additions & 0 deletions coderd/workspacebuilds.go
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,14 @@ func (api *API) buildTimings(ctx context.Context, build database.WorkspaceBuild)
})
}
for _, agent := range agents {
if agent.FirstConnectedAt.Time.IsZero() {
api.Logger.Debug(ctx, "ignoring agent connection timing with zero first connected time",
slog.F("workspace_id", build.WorkspaceID),
slog.F("workspace_agent_id", agent.ID),
slog.F("workspace_build_id", build.ID),
)
continue
}
res.AgentConnectionTimings = append(res.AgentConnectionTimings, codersdk.AgentConnectionTiming{
WorkspaceAgentID: agent.ID.String(),
WorkspaceAgentName: agent.Name,
Expand Down
Loading
0