8000 test: insights metrics: verify plugin usage by mtojek · Pull Request #11156 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

test: insights metrics: verify plugin usage #11156

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

Merged
merged 3 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Same for VS code
  • Loading branch information
mtojek committed Dec 12, 2023
commit 15ea095fcc90232ec511a93ce0f768f4f4351f35
3 changes: 2 additions & 1 deletion coderd/prometheusmetrics/insights/metricscollector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ func TestCollectInsights(t *testing.T) {
ConnectionsByProto: map[string]int64{"TCP": 1},
// ConnectionCount must be positive as database query ignores stats with no active connections at the time frame
ConnectionCount: 74,
// SessionCountJetBrains must be positive, but the exact value is ignored.
// SessionCountJetBrains, SessionCountVSCode must be positive, but the exact value is ignored.
// Database query approximates it to 60s of usage.
SessionCountJetBrains: 47,
SessionCountVSCode: 34,
})
require.NoError(t, err, "unable to post fake stats")

Expand Down
2 changes: 1 addition & 1 deletion coderd/prometheusmetrics/insights/testdata/insights-metrics.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"coderd_insights_applications_usage_seconds[application_name=JetBrains,slug=,template_name=golden-template]": 60,
"coderd_insights_applications_usage_seconds[application_name=Visual Studio Code,slug=,template_name=golden-template]": 0,
"coderd_insights_applications_usage_seconds[application_name=Visual Studio Code,slug=,template_name=golden-template]": 60,
"coderd_insights_applications_usage_seconds[application_name=Web Terminal,slug=,template_name=golden-template]": 0,
"coderd_insights_applications_usage_seconds[application_name=SSH,slug=,template_name=golden-template]": 60,
"coderd_insights_applications_usage_seconds[application_name=Golden Slug,slug=golden-slug,template_name=golden-template]": 120,
Expand Down
0