feat: add agent timings#14713
Conversation
3d5cf74 to
41e8085
Compare
Not sure how this came to be, I do not recall manually changing these files.
mafredri
left a comment
There was a problem hiding this comment.
Nice job piping this through! And sorry for the amount of comments. 😅
| enum Stage { | ||
| START = 0; | ||
| STOP = 1; | ||
| CRON = 2; |
There was a problem hiding this comment.
I feel there's a slight mismatch in naming here as I have trouble fitting cron under stage, but I also don't have a better suggestion 😅, just an observation.
There was a problem hiding this comment.
Yeah it does feel a little strange. Couldn't think of a better way of handling this though.
| 'cron' | ||
| ); | ||
|
|
||
| CREATE TABLE workspace_agent_script_timings |
There was a problem hiding this comment.
I think calling this timings could work but I feel it's primarily a exec_status or exec_result table, it contains timing information which feels like more of a side-effect.
Renaming it would give us more flexibility to store more data in it if needed.
There was a problem hiding this comment.
Renaming a table isn't too difficult; we could do this as a follow-up if needed?
| DROP TYPE IF EXISTS workspace_agent_script_timing_status CASCADE; | ||
| DROP TYPE IF EXISTS workspace_agent_script_timing_stage CASCADE; |
There was a problem hiding this comment.
note: DROP TYPE ... CASCADE is already done for 000246_provisioner_job_timings
johnstcn
left a comment
There was a problem hiding this comment.
I don't have any further blocking comments.
mafredri
left a comment
There was a problem hiding this comment.
Looking great, thanks for your hard work on this PR!
dannykopping
left a comment
There was a problem hiding this comment.
Post-merge approval, excellent work! ✅
Closes #14630
Adds timing information for workspace agent scripts.
This change adds:
display_name,idcolumns toworkspace_agent_scriptstableworkspace_agent_script_timingstableDemo
Extend the default docker template with the following scripts.
Create a workspace, start it, then stop it. This then gives us the following data in our database.
coder=# select * from workspace_agent_script_timings;