Skip to content

feat: Fix Deployment DAUs to work with local timezones #7647

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 18 commits into from
May 30, 2023
Prev Previous commit
Format
  • Loading branch information
Emyrk committed May 24, 2023
commit a86bcd67e2904cf3c09203fcf11c0f3adbcffda1
16 changes: 7 additions & 9 deletions coderd/metricscache/metricscache.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ import (
"github.com/coder/retry"
)

var (
// timezoneOffsets are the timezones that are cached and supported.
// Any non-listed timezone offsets will need to use the closest supported one.
timezoneOffsets = []int{
0, // UTC - is listed first intentionally.
-12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1,
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
}
)
// timezoneOffsets are the timezones that are cached and supported.
// Any non-listed timezone offsets will need to use the closest supported one.
var timezoneOffsets = []int{
0, // UTC - is listed first intentionally.
-12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1,
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
}

// Cache holds the template metrics.
// The aggregation queries responsible for these values can take up to a minute
Expand Down