Skip to content

Commit 07cdc0b

Browse files
committed
add 1h usage to other user
1 parent 930d7ef commit 07cdc0b

4 files changed

+17
-11
lines changed

coderd/insights_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,8 +1134,14 @@ func TestTemplateInsights_Golden(t *testing.T) {
11341134
appUsage: []appUsage{},
11351135
},
11361136
users[1].workspaces[0]: {
1137-
agentStats: []agentStat{},
1138-
appUsage: []appUsage{},
1137+
agentStats: []agentStat{
1138+
{ // One hour of usage.
1139+
startedAt: frozenWeekAgo,
1140+
endedAt: frozenWeekAgo.Add(time.Hour),
1141+
sessionCountSSH: 1,
1142+
},
1143+
},
1144+
appUsage: []appUsage{},
11391145
},
11401146
users[2].workspaces[0]: {
11411147
agentStats: []agentStat{},

coderd/testdata/insights/multiple_users_and_workspaces_week_all_templates.json.golden

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"00000000-0000-0000-0000-000000000001",
77
"00000000-0000-0000-0000-000000000002"
88
],
9-
"active_users": 1,
9+
"active_users": 2,
1010
"apps_usage": [
1111
{
1212
"template_ids": [
@@ -50,7 +50,7 @@
5050
"display_name": "SSH",
5151
"slug": "ssh",
5252
"icon": "/icon/terminal.svg",
53-
"seconds": 4500
53+
"seconds": 8100
5454
},
5555
{
5656
"template_ids": [
@@ -85,7 +85,7 @@
8585
"00000000-0000-0000-0000-000000000002"
8686
],
8787
"interval": "day",
88-
"active_users": 1
88+
"active_users": 2
8989
},
9090
{
9191
"start_time": "2023-08-16T00:00:00Z",

coderd/testdata/insights/multiple_users_and_workspaces_week_deployment_wide.json.golden

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"00000000-0000-0000-0000-000000000001",
77
"00000000-0000-0000-0000-000000000002"
88
],
9-
"active_users": 1,
9+
"active_users": 2,
1010
"apps_usage": [
1111
{
1212
"template_ids": [
@@ -50,7 +50,7 @@
5050
"display_name": "SSH",
5151
"slug": "ssh",
5252
"icon": "/icon/terminal.svg",
53-
"seconds": 4500
53+
"seconds": 8100
5454
},
5555
{
5656
"template_ids": [
@@ -85,7 +85,7 @@
8585
"00000000-0000-0000-0000-000000000002"
8686
],
8787
"interval": "day",
88-
"active_users": 1
88+
"active_users": 2
8989
},
9090
{
9191
"start_time": "2023-08-16T00:00:00Z",

coderd/testdata/insights/multiple_users_and_workspaces_week_first_template.json.golden

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"template_ids": [
66
"00000000-0000-0000-0000-000000000001"
77
],
8-
"active_users": 1,
8+
"active_users": 2,
99
"apps_usage": [
1010
{
1111
"template_ids": [
@@ -45,7 +45,7 @@
4545
"display_name": "SSH",
4646
"slug": "ssh",
4747
"icon": "/icon/terminal.svg",
48-
"seconds": 4500
48+
"seconds": 8100
4949
},
5050
{
5151
"template_ids": [
@@ -78,7 +78,7 @@
7878
"00000000-0000-0000-0000-000000000001"
7979
],
8080
"interval": "day",
81-
"active_users": 1
81+
"active_users": 2
8282
},
8383
{
8484
"start_time": "2023-08-16T00:00:00Z",

0 commit comments

Comments
 (0)