Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromcoder/coder

feat: add agent timings#1

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
lizard-boy wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromdm-add-agent-timings
Open

Conversation

lizard-boy
Copy link

Adds timing information for workspace agent scripts.

Closescoder#14630

Demo
Extend the default docker template with the following scripts.

resource "coder_script" "say_hi" {  agent_id     = coder_agent.main.id  display_name = "say hi"  run_on_start       = true  start_blocks_login = true  script = <<EOF    #!/bin/sh    echo "Hi!"  EOF}resource "coder_script" "exit_1" {  agent_id     = coder_agent.main.id  display_name = "exit 1"  run_on_start       = true  start_blocks_login = true  script = <<EOF    #!/bin/sh    exit 1  EOF}

Create a workspace and start it. This then gives us the following data in our database.

coder=# select * from workspace_agent_script_timings;

                job_id                |  display_name  |          started_at           |           ended_at            | exit_code--------------------------------------+----------------+-------------------------------+-------------------------------+----------- d600be5d-6689-4a19-ba2b-fbecb662a94e | say hi         | 2024-09-18 15:03:35.672631+00 | 2024-09-18 15:03:35.675239+00 |         0 d600be5d-6689-4a19-ba2b-fbecb662a94e | exit 1         | 2024-09-18 15:03:35.672581+00 | 2024-09-18 15:03:35.675337+00 |         1 d600be5d-6689-4a19-ba2b-fbecb662a94e | Startup Script | 2024-09-18 15:03:35.672475+00 | 2024-09-18 15:03:42.202995+00 |         0

The provisioner job timings was added in a previous PR but to show that thejob_id column correlates I'm showing the data.

SELECT job_id, started_at, ended_at, resource FROM provisioner_job_timings;

                job_id                |          started_at           |           ended_at            |           resource--------------------------------------+-------------------------------+-------------------------------+------------------------------- d600be5d-6689-4a19-ba2b-fbecb662a94e | 2024-09-18 15:03:28.43633+00  | 2024-09-18 15:03:31.998981+00 | state file d600be5d-6689-4a19-ba2b-fbecb662a94e | 2024-09-18 15:03:32.549759+00 | 2024-09-18 15:03:32.552971+00 | data.coder_workspace.me d600be5d-6689-4a19-ba2b-fbecb662a94e | 2024-09-18 15:03:32.549084+00 | 2024-09-18 15:03:32.55025+00  | data.coder_provisioner.me d600be5d-6689-4a19-ba2b-fbecb662a94e | 2024-09-18 15:03:32.549335+00 | 2024-09-18 15:03:32.552113+00 | data.coder_workspace_owner.me d600be5d-6689-4a19-ba2b-fbecb662a94e | 2024-09-18 15:03:32.608787+00 | 2024-09-18 15:03:33.13758+00  | state file d600be5d-6689-4a19-ba2b-fbecb662a94e | 2024-09-18 15:03:33.615702+00 | 2024-09-18 15:03:33.622065+00 | coder_script.exit_1 d600be5d-6689-4a19-ba2b-fbecb662a94e | 2024-09-18 15:03:33.594193+00 | 2024-09-18 15:03:33.600515+00 | docker_volume.home_volume d600be5d-6689-4a19-ba2b-fbecb662a94e | 2024-09-18 15:03:33.597609+00 | 2024-09-18 15:03:33.605776+00 | coder_agent.main d600be5d-6689-4a19-ba2b-fbecb662a94e | 2024-09-18 15:03:33.617404+00 | 2024-09-18 15:03:33.623269+00 | coder_app.code-server d600be5d-6689-4a19-ba2b-fbecb662a94e | 2024-09-18 15:03:34.32222+00  | 2024-09-18 15:03:34.872399+00 | docker_container.workspace[0] d600be5d-6689-4a19-ba2b-fbecb662a94e | 2024-09-18 15:03:33.614933+00 | 2024-09-18 15:03:33.620057+00 | coder_script.say_hi d600be5d-6689-4a19-ba2b-fbecb662a94e | 2024-09-18 15:03:33.596363+00 | 2024-09-18 15:03:34.302365+00 | docker_image.main

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add agent script timings
2 participants
@lizard-boy@DanielleMaywood

[8]ページ先頭

©2009-2025 Movatter.jp