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

feat(coderd): add template app usage to insights#9138

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

Merged

Conversation

mafredri
Copy link
Member

@mafredrimafredri commentedAug 16, 2023
edited
Loading

This PR adds template app usage to insights. Once merged, the dashboard will automatically start showing these.

Fixes#8658

Notable changes:

  • Simplified thegenerate_series a bit via bettersqlc workaround
  • Query indentation was fixed (there was some tab spacing)
  • Changed usage granularity from 5 minutes to 1 minute, I feel 5 minutes may skew the numbers too much for short lived sessions

Notes:

  • Unfortunately I couldn't combineGetTemplateInsights andGetTemplateAppInsights into a single query because ofsqlc limitations, and I did not want to trade type-safety for performance

@mafredrimafredri changed the titlefeat(coderd): report template app usage insightsfeat(coderd): add template app usage to insightsAug 16, 2023
@mafredri
Copy link
MemberAuthor

Demo:
image

appUsage, err = tx.GetTemplateAppInsights(ctx, database.GetTemplateAppInsightsParams{
StartTime: startTime,
EndTime: endTime,
TemplateIDs: templateIDs,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hint: while you are writing unit tests, please make sure that cover paths withTemplateIDs and without them (ALL).

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I will create an improved test-suite as a follow-up to this PR which will perform tests for multiple templates as well.

@mafredrimafredriforce-pushed themafredri/feat-add-app-usage-to-template-insights-2 branch from7707313 tocacebb9CompareAugust 18, 2023 14:38
@mafredri
Copy link
MemberAuthor

I've added basic tests and will improve upon them in a follow up PR. I've also manually confirmed that the query changes produces the same data ondev.coder.com when disregarding the new data.

A funny side-effect of using the 5 minute windows is that when testing, I:

  1. Opened code-server
  2. Refreshed insights, there was immediately 5 minutes code-server usage
  3. Waited 1 minute
  4. Refreshed insights, there was 10 minutes code-server usage because the clock went from :39 to :40

More users will skew nr. 4 even more, so I'm convinced we need to reduce the window whilst maintaining or improving query performance, and perhaps not use one at all for template apps since it's not strictly required.

mtojek reacted with thumbs up emoji

@mafredrimafredri marked this pull request as ready for reviewAugust 18, 2023 17:52
@mtojekmtojek self-requested a reviewAugust 21, 2023 08:46
Copy link
Member

@mtojekmtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Is there anything left for@BrunoQuaresma to polish in the site area?

@mafredrimafredri merged commit03453b1 intomainAug 21, 2023
@mafredrimafredri deleted the mafredri/feat-add-app-usage-to-template-insights-2 branchAugust 21, 2023 12:08
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 21, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

@mtojekmtojekmtojek approved these changes

Assignees

@mafredrimafredri

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Trackcoder_app usage in insights API
3 participants
@mafredri@johnstcn@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp