mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(site): add agent connection timings (#15276)
Local preview: <img width="1260" alt="Screenshot 2024-10-29 at 16 16 01" src="https://github.com/user-attachments/assets/10fdb20d-1f2a-4b0a-a8a1-171050ee620d"> Close https://github.com/coder/internal/issues/116 --------- Co-authored-by: Danny Kopping <danny@coder.com>
This commit is contained in:
co-authored by
Danny Kopping
parent
18ef954a03
commit
e232aee011
@@ -5899,15 +5899,31 @@ func (q *FakeQuerier) GetWorkspaceAgentScriptTimingsByBuildID(ctx context.Contex
|
||||
break
|
||||
}
|
||||
}
|
||||
if script.ID == uuid.Nil {
|
||||
return nil, xerrors.Errorf("script with ID %s not found", t.ScriptID)
|
||||
}
|
||||
|
||||
var agent database.WorkspaceAgent
|
||||
for _, a := range agents {
|
||||
if a.ID == script.WorkspaceAgentID {
|
||||
agent = a
|
||||
break
|
||||
}
|
||||
}
|
||||
if agent.ID == uuid.Nil {
|
||||
return nil, xerrors.Errorf("agent with ID %s not found", t.ScriptID)
|
||||
}
|
||||
|
||||
rows = append(rows, database.GetWorkspaceAgentScriptTimingsByBuildIDRow{
|
||||
ScriptID: t.ScriptID,
|
||||
StartedAt: t.StartedAt,
|
||||
EndedAt: t.EndedAt,
|
||||
ExitCode: t.ExitCode,
|
||||
Stage: t.Stage,
|
||||
Status: t.Status,
|
||||
DisplayName: script.DisplayName,
|
||||
ScriptID: t.ScriptID,
|
||||
StartedAt: t.StartedAt,
|
||||
EndedAt: t.EndedAt,
|
||||
ExitCode: t.ExitCode,
|
||||
Stage: t.Stage,
|
||||
Status: t.Status,
|
||||
DisplayName: script.DisplayName,
|
||||
WorkspaceAgentID: agent.ID,
|
||||
WorkspaceAgentName: agent.Name,
|
||||
})
|
||||
}
|
||||
return rows, nil
|
||||
|
||||
Reference in New Issue
Block a user