Skip to content

Commit ecd27f4

Browse files
committed
more activity
1 parent fa1ad62 commit ecd27f4

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

coderd/insights_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,18 @@ func TestTemplateInsights_Golden(t *testing.T) {
810810
sessionCountVSCode: 1,
811811
sessionCountSSH: 1,
812812
},
813+
{ // One hour of usage.
814+
startedAt: frozenWeekAgo.AddDate(0, 0, -12),
815+
endedAt: frozenWeekAgo.AddDate(0, 0, -12).Add(time.Hour),
816+
sessionCountSSH: 1,
817+
sessionCountReconnectingPTY: 0,
818+
},
819+
{ // Another one hour of usage, but "active users" shouldn't be increased twice.
820+
startedAt: frozenWeekAgo.AddDate(0, 0, -10),
821+
endedAt: frozenWeekAgo.AddDate(0, 0, -10).Add(time.Hour),
822+
sessionCountSSH: 0,
823+
sessionCountReconnectingPTY: 1,
824+
},
813825
},
814826
appUsage: []appUsage{
815827
// TODO(mafredri): This doesn't behave correctly right now

coderd/testdata/insights/multiple_users_and_workspaces_three_weeks_second_template.json.golden

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"display_name": "Web Terminal",
3636
"slug": "reconnecting-pty",
3737
"icon": "/icon/terminal.svg",
38-
"seconds": 0
38+
"seconds": 3600
3939
},
4040
{
4141
"template_ids": [
@@ -45,7 +45,7 @@
4545
"display_name": "SSH",
4646
"slug": "ssh",
4747
"icon": "/icon/terminal.svg",
48-
"seconds": 3600
48+
"seconds": 7200
4949
},
5050
{
5151
"template_ids": [
@@ -64,9 +64,11 @@
6464
{
6565
"start_time": "2023-08-01T00:00:00Z",
6666
"end_time": "2023-08-08T00:00:00Z",
67-
"template_ids": [],
67+
"template_ids": [
68+
"00000000-0000-0000-0000-000000000002"
69+
],
6870
"interval": "week",
69-
"active_users": 0
71+
"active_users": 1
7072
},
7173
{
7274
"start_time": "2023-08-08T00:00:00Z",

0 commit comments

Comments
 (0)