Skip to content

feat: expose insights into user activity #9807

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 26 commits into from
Sep 26, 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
Next Next commit
linter
  • Loading branch information
mtojek committed Sep 26, 2023
commit 7a5390566d5e1e3f17f7a37d1b761dc79f9df11c
4 changes: 2 additions & 2 deletions coderd/insights_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ func TestTemplateInsights_Golden(t *testing.T) {
frozenWeekAgoSaoPaulo, err := time.ParseInLocation(time.DateTime, frozenWeekAgo.Format(time.DateTime), saoPaulo)
require.NoError(t, err)

//nolint:dupl For testing purposes
//nolint:dupl // For testing purposes
makeBaseTestData := func(templates []*testTemplate, users []*testUser) map[*testWorkspace]testDataGen {
return map[*testWorkspace]testDataGen{
users[0].workspaces[0]: {
Expand Down Expand Up @@ -1667,7 +1667,7 @@ func TestUserActivityInsights_Golden(t *testing.T) {
frozenWeekAgoSaoPaulo, err := time.ParseInLocation(time.DateTime, frozenWeekAgo.Format(time.DateTime), saoPaulo)
require.NoError(t, err)

//nolint:dupl For testing purposes
//nolint:dupl // For testing purposes
makeBaseTestData := func(templates []*testTemplate, users []*testUser) map[*testWorkspace]testDataGen {
return map[*testWorkspace]testDataGen{
users[0].workspaces[0]: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000002"
],
"user_id": "e114f18f-4e75-4533-bfe2-cb8acbad7563",
"user_id": "aba84ddd-48c3-4041-98db-f80913a424a3",
"username": "user1",
"avatar_url": "",
"seconds": 32400
Copy link
Member

Choose a reason for hiding this comment

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

Note-to-self: At first I thought this looked off, comparing the template golden file for the same setup, but upon verifying with the data it looks good, there is indeed 9h of distinct usage. 👍🏻

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000001"
],
"user_id": "31972c11-d06a-44e5-ace7-d95192eaa8d6",
"user_id": "037c6a21-c805-46d8-a1ff-d98096afb44a",
"username": "user2",
"avatar_url": "",
"seconds": 3600
Expand All @@ -21,7 +21,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000003"
],
"user_id": "cdb811f8-93c2-443a-8266-4d47b55f4094",
"user_id": "297dcbb4-2463-487a-92cd-7443d8d2a82d",
"username": "user3",
"avatar_url": "",
"seconds": 4200
Expand All @@ -31,7 +31,7 @@
"00000000-0000-0000-0000-000000000001",
"00000000-0000-0000-0000-000000000002"
],
"user_id": "e114f18f-4e75-4533-bfe2-cb8acbad7563",
"user_id": "aba84ddd-48c3-4041-98db-f80913a424a3",
"username": "user1",
"avatar_url": "",
"seconds": 30540
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000001"
],
"user_id": "31972c11-d06a-44e5-ace7-d95192eaa8d6",
"user_id": "037c6a21-c805-46d8-a1ff-d98096afb44a",
"username": "user2",
"avatar_url": "",
"seconds": 3600
Expand All @@ -21,7 +21,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000003"
],
"user_id": "cdb811f8-93c2-443a-8266-4d47b55f4094",
"user_id": "297dcbb4-2463-487a-92cd-7443d8d2a82d",
"username": "user3",
"avatar_url": "",
"seconds": 4200
Expand All @@ -31,7 +31,7 @@
"00000000-0000-0000-0000-000000000001",
"00000000-0000-0000-0000-000000000002"
],
"user_id": "e114f18f-4e75-4533-bfe2-cb8acbad7563",
"user_id": "aba84ddd-48c3-4041-98db-f80913a424a3",
"username": "user1",
"avatar_url": "",
"seconds": 30540
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000001"
],
"user_id": "31972c11-d06a-44e5-ace7-d95192eaa8d6",
"user_id": "037c6a21-c805-46d8-a1ff-d98096afb44a",
"username": "user2",
"avatar_url": "",
"seconds": 3600
Expand All @@ -19,7 +19,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000001"
],
"user_id": "e114f18f-4e75-4533-bfe2-cb8acbad7563",
"user_id": "aba84ddd-48c3-4041-98db-f80913a424a3",
"username": "user1",
"avatar_url": "",
"seconds": 5340
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000001"
],
"user_id": "31972c11-d06a-44e5-ace7-d95192eaa8d6",
"user_id": "037c6a21-c805-46d8-a1ff-d98096afb44a",
"username": "user2",
"avatar_url": "",
"seconds": 3600
Expand All @@ -21,7 +21,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000003"
],
"user_id": "cdb811f8-93c2-443a-8266-4d47b55f4094",
"user_id": "297dcbb4-2463-487a-92cd-7443d8d2a82d",
"username": "user3",
"avatar_url": "",
"seconds": 600
Expand All @@ -31,7 +31,7 @@
"00000000-0000-0000-0000-000000000001",
"00000000-0000-0000-0000-000000000002"
],
"user_id": "e114f18f-4e75-4533-bfe2-cb8acbad7563",
"user_id": "aba84ddd-48c3-4041-98db-f80913a424a3",
"username": "user1",
"avatar_url": "",
"seconds": 23280
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000002"
],
"user_id": "e114f18f-4e75-4533-bfe2-cb8acbad7563",
"user_id": "aba84ddd-48c3-4041-98db-f80913a424a3",
"username": "user1",
"avatar_url": "",
"seconds": 25200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000003"
],
"user_id": "cdb811f8-93c2-443a-8266-4d47b55f4094",
"user_id": "297dcbb4-2463-487a-92cd-7443d8d2a82d",
"username": "user3",
"avatar_url": "",
"seconds": 4200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000001"
],
"user_id": "31972c11-d06a-44e5-ace7-d95192eaa8d6",
"user_id": "037c6a21-c805-46d8-a1ff-d98096afb44a",
"username": "user2",
"avatar_url": "",
"seconds": 7200
Expand All @@ -21,7 +21,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000003"
],
"user_id": "cdb811f8-93c2-443a-8266-4d47b55f4094",
"user_id": "297dcbb4-2463-487a-92cd-7443d8d2a82d",
"username": "user3",
"avatar_url": "",
"seconds": 4200
Expand All @@ -31,7 +31,7 @@
"00000000-0000-0000-0000-000000000001",
"00000000-0000-0000-0000-000000000002"
],
"user_id": "e114f18f-4e75-4533-bfe2-cb8acbad7563",
"user_id": "aba84ddd-48c3-4041-98db-f80913a424a3",
"username": "user1",
"avatar_url": "",
"seconds": 29820
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000001"
],
"user_id": "31972c11-d06a-44e5-ace7-d95192eaa8d6",
"user_id": "037c6a21-c805-46d8-a1ff-d98096afb44a",
"username": "user2",
"avatar_url": "",
"seconds": 3600
Expand All @@ -19,7 +19,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000001"
],
"user_id": "e114f18f-4e75-4533-bfe2-cb8acbad7563",
"user_id": "aba84ddd-48c3-4041-98db-f80913a424a3",
"username": "user1",
"avatar_url": "",
"seconds": 5340
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000001"
],
"user_id": "31972c11-d06a-44e5-ace7-d95192eaa8d6",
"user_id": "037c6a21-c805-46d8-a1ff-d98096afb44a",
"username": "user2",
"avatar_url": "",
"seconds": 7200
Expand All @@ -21,7 +21,7 @@
"template_ids": [
"00000000-0000-0000-0000-000000000003"
],
"user_id": "cdb811f8-93c2-443a-8266-4d47b55f4094",
"user_id": "297dcbb4-2463-487a-92cd-7443d8d2a82d",
"username": "user3",
"avatar_url": "",
"seconds": 4200
Expand All @@ -31,7 +31,7 @@
"00000000-0000-0000-0000-000000000001",
"00000000-0000-0000-0000-000000000002"
],
"user_id": "e114f18f-4e75-4533-bfe2-cb8acbad7563",
"user_id": "aba84ddd-48c3-4041-98db-f80913a424a3",
"username": "user1",
"avatar_url": "",
"seconds": 29820
Expand Down