Skip to content

feat: add total users insight #15486

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

Closed
wants to merge 23 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
Use offset instead of zone
  • Loading branch information
BrunoQuaresma committed Nov 14, 2024
commit d340e2ddf0f8b20be49a4df97ccbedae0e2c384c
4 changes: 2 additions & 2 deletions coderd/insights.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,11 @@
return
}

zone, _ := startTime.Zone()
_, offset := startTime.Zone()
rows, err := api.Database.GetAccumulatedUsersInsights(ctx, database.GetAccumulatedUsersInsightsParams{
StartTime: startTime,
EndTime: endTime,
Timezone: zone,
Timezone: string(offset),

Check failure on line 513 in coderd/insights.go

View workflow job for this annotation

GitHub Actions / test-go-pg

conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

Check failure on line 513 in coderd/insights.go

View workflow job for this annotation

GitHub Actions / test-go-pg

conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

Check failure on line 513 in coderd/insights.go

View workflow job for this annotation

GitHub Actions / test-go (ubuntu-latest)

conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

Check failure on line 513 in coderd/insights.go

View workflow job for this annotation

GitHub Actions / test-go (ubuntu-latest)

conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

Check failure on line 513 in coderd/insights.go

View workflow job for this annotation

GitHub Actions / test-go (macos-latest)

conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

Check failure on line 513 in coderd/insights.go

View workflow job for this annotation

GitHub Actions / test-go (macos-latest)

conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

Check failure on line 513 in coderd/insights.go

View workflow job for this annotation

GitHub Actions / test-go (windows-2022)

conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

Check failure on line 513 in coderd/insights.go

View workflow job for this annotation

GitHub Actions / test-go (windows-2022)

conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

Check failure on line 513 in coderd/insights.go

View workflow job for this annotation

GitHub Actions / lint

string-of-int: dubious conversion of an integer into a string, use strconv.Itoa (revive)

Check failure on line 513 in coderd/insights.go

View workflow job for this annotation

GitHub Actions / test-go-pg-16

conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

Check failure on line 513 in coderd/insights.go

View workflow job for this annotation

GitHub Actions / test-go-pg-16

conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

Check failure on line 513 in coderd/insights.go

View workflow job for this annotation

GitHub Actions / test-go-race

conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

Check failure on line 513 in coderd/insights.go

View workflow job for this annotation

GitHub Actions / test-go-race

conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't behave like intended. You need to use the strconv package instead.

})
if err != nil {
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
Expand Down
Loading