-
Notifications
You must be signed in to change notification settings - Fork 887
feat: add agent timings #14713
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
feat: add agent timings #14713
Conversation
3d5cf74
to
41e8085
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work!
Not sure how this came to be, I do not recall manually changing these files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming a table isn't too difficult; we could do this as a follow-up if needed?
coderd/database/migrations/testdata/fixtures/000256_workspace_agent_script_timings.up.sql
Outdated
Show resolved
Hide resolved
coderd/database/migrations/000256_workspace_agent_script_timings.up.sql
Outdated
Show resolved
Hide resolved
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: DROP TYPE ... CASCADE
is already done for 000246_provisioner_job_timings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have any further blocking comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great, thanks for your hard work on this PR!
coderd/database/migrations/000257_workspace_agent_script_timings.up.sql
Outdated
Show resolved
Hide resolved
coderd/database/migrations/000257_workspace_agent_script_timings.up.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Post-merge approval, excellent work! ✅
Closes #14630
Adds timing information for workspace agent scripts.
This change adds:
display_name
,id
columns toworkspace_agent_scripts
tableworkspace_agent_script_timings
tableDemo
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;