-
Notifications
You must be signed in to change notification settings - Fork 899
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
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f7f5d66
chore: Add timezone param to DAU SQL query
Emyrk 45e8342
Merge DAUs response
Emyrk b502940
Pass time offsets to metricscache
Emyrk 9b970ae
Fix unit tests
Emyrk 4eb43c1
Add unit tests for tzs to offsets
Emyrk 1949217
Add unit test for closest
Emyrk b5b5824
Return after http error
Emyrk 448d5fb
make gen
Emyrk 5976ac4
add comments
Emyrk 6ff576b
Fix imports
Emyrk a91debd
missing import
Emyrk 0d19300
add unit test
Emyrk d7e8b25
Formatting
Emyrk bf1bd47
Fix FE to use singulare DAUsResponse
Emyrk dc324a8
Fix unit test
Emyrk bb7c392
Make gen
Emyrk 16c9c8f
Format
Emyrk a86bcd6
Format
Emyrk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Pass time offsets to metricscache
- Loading branch information
commit b50294017be17a523661f93482a0140c4fb885d6
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand the purpose of only allowing a set number of timezones. What would be the harm in just passing them to Postgres verbatim?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by that? There are only 24 timezones, and I just used this instead of input validation because idk if there is some odd edge case of a -13 offset.
As for passing it to postgres. We cache these values and reuse them for all calls. So when the caller requests the data, they pull from a cache, they do not trigger a query. So the data must already be available.
I suppose a better cache would populate things lazily, but that would require a larger refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are more than 24 time zones, e.g. India is 10.5h ahead of CST.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am doing a +/- 12hr offset to UTC (0). So India would use the +10 bucket if it's +10.5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, I think I misinterpreted your comment as stating that there are 24 hours timezone in the world. I think an hour error tolerance is immaterial, so am good with the implentation you've described. But, I haven't checked the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that makes sense. I forgot that everything is cached in the background rather than on-demand. It's unfortunate that we need
count(templates) * 24
queries for each tick though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is unfortunate, but it runs once per hour, so I am not too worried.