Skip to content

Build timings: I have to refresh the page to see startup script timing #15273

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

Closed
bpmct opened this issue Oct 29, 2024 · 11 comments · Fixed by #15728
Closed

Build timings: I have to refresh the page to see startup script timing #15273

bpmct opened this issue Oct 29, 2024 · 11 comments · Fixed by #15728
Assignees
Labels
observability Issues related to observability (metrics, dashboards, alerts, opentelemetry) s3 Bugs that confuse, annoy, or are purely cosmetic site Area: frontend dashboard

Comments

@bpmct
Copy link
Member

bpmct commented Oct 29, 2024

Screen.Recording.2024-10-29.at.9.47.39.AM.mov
@coder-labeler coder-labeler bot added bug risk Prone to bugs observability Issues related to observability (metrics, dashboards, alerts, opentelemetry) labels Oct 29, 2024
@dannykopping
Copy link
Contributor

cc @BrunoQuaresma

@BrunoQuaresma
Copy link
Collaborator

Hmm... it seems the timings are being added as the agent's lifecycle is set to ready. 🤔 I will try to figure out a better way to refresh the timings when the agent is ready.

@BrunoQuaresma BrunoQuaresma self-assigned this Nov 5, 2024
@matifali matifali added s3 Bugs that confuse, annoy, or are purely cosmetic site Area: frontend dashboard and removed bug risk Prone to bugs labels Nov 7, 2024
@BrunoQuaresma
Copy link
Collaborator

To solve this issue, we need to define when the agent timings are ready to be displayed. I’m considering the following logic:

  • The agent is marked as ready.
  • If the agent has scripts, check that timings for each script are present.
  • If the script timings aren’t present, continue refetching until they are available.

@dannykopping
Copy link
Contributor

Could we perhaps always show the timings, and when there's an update: prompt the user to refresh?

Since this is such a long-running process, I think we need to be able to show intermediate phases. If we did the above we could simply poll, and if the state (i.e. timings JSON) has changed since the currently visible state then prompt. WDYT?

@BrunoQuaresma
Copy link
Collaborator

@dannykopping, it makes sense. @chrifro, do you have any ideas on how we could show or have a "pending" state for the chart? Or at least for the "run startup scripts"?

@chrifro
Copy link

chrifro commented Nov 8, 2024

Could we perhaps always show the timings

With "timings" do you mean the data under "provisioning"?

Would this work?
Image

What happens when new data is available? Can we load it automatically or do we need to reload the page?
Image

See Figma

@BrunoQuaresma
Copy link
Collaborator

@chrifro and @dannykopping, what do you think about this? I believe this provides more context to the user regarding why it is still loading.

Image

@dannykopping
Copy link
Contributor

@BrunoQuaresma looks good! The copy's grammar should be corrected to "Waiting for agent to become ready...".

@BrunoQuaresma
Copy link
Collaborator

BrunoQuaresma commented Dec 2, 2024

When refetching the timings to progressively display the agent scripts, it causes a layout shift because the chart recalculates the best intervals to fit the bar sizes and inner elements. This issue looks strange and buggy. To avoid the layout shift, I see two options:

  1. Display the timings only when all timings are available: This eliminates the need to recalculate intervals later.
  2. Calculate intervals and sizes only on the first render: The downside is that without all the data, the chart may not determine the optimal sizes and intervals.

In my opinion, the first option is the most reasonable and safest. I suggest we move forward with it and, depending on user feedback, we can consider implementing the second option later. WDYT? @dannykopping @chrifro

Screen.Recording.2024-12-02.at.11.53.04.mov

@dannykopping
Copy link
Contributor

Yeah I think the first option makes the most sense. You only really need to know the timing information retrospectively; there isn't much value in seeing it while the build is taking place.

@chrifro
Copy link

chrifro commented Dec 3, 2024

I'm also for option 1 🤝 ✨

BrunoQuaresma added a commit that referenced this issue Dec 3, 2024
- [Refetch timings until script timings are
present](2181bec)
- [Stay on loading state when agent script timings are
empty](b16fad1)

Fix #15273
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
observability Issues related to observability (metrics, dashboards, alerts, opentelemetry) s3 Bugs that confuse, annoy, or are purely cosmetic site Area: frontend dashboard
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants