-
Notifications
You must be signed in to change notification settings - Fork 370
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
Add option to display timestamps in the local system timezone #3530
Conversation
Hi, and thank you so much for this PR! I strongly suggest switching out the boolean for an enum: #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
enum TimeZone {
Local,
Utc,
} This will make the code more readable (basically self-documenting), but also allow us to easily add custom timezones in the future, if we so desire. The store mostly uses time formatting for trace logging and error messages, and for that UTC is fine. You can create a helper |
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.
First of all thank you so much for contributing and tackling this feature! And welcome to Rust 😄 .
- I went with the pattern of passing show_timestamps_in_local_timezone into format(), which seems easiest to keep the function stateless. But curious if there's another pattern to do this I missed in the codebase?
I think that's the correct way to got about it here, but instead of making it a an enum (something like enum TimeFormat
?) would make things more readable and extensible :)
- I hard-coded show_timestamps_in_local_timezone = false in several locations in arrow_store/. I believe this is correct because this is the code to serialize data, but perhaps I missed something there?
Didn't go through all the callsites yet, but it looks like this affects mostly debug printing, tests and examples internal to arrow_store
. So yes, for those the UTC behavior seems best 👍
- Cargo.lock had a new dependency added, I believe because I added local-offset here: time = { workspace = true, features = ["formatting", "macros", "local-offset"] }.
Digged after this a bit and can confirm. The local-offset
feature drags this dependency in on linux https://github.com/time-rs/time/blob/main/time/Cargo.toml#L62. But it seems to be super small, so that's alright.
- I have a failing unit test locally which looks like it's in crates/re_sdk/src/recording_stream.rs.
I actually have the same failure on main running locally Oo. Let me check what's up there...
- Finally, there are quite a few TODO's left to do
I left some comments 👍
General direction works I think. Passing the setting through every corner is annoying on one hand but more flexible in the long run. Relatedly, I'm not sure yet where we want to store the setting in the long run and how granular this kind of thing should be configurable but for the moment it's definitely the right place.
As you already know, if you need quick feedback or answers to question where the Github format doesn't do you can always post on Discord as well :)
looks like @emilk wrote much of the same while I was busy 😅 |
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.
(brief scroll over new TODO
notes / ones I might have missed :))
Okay so removed the last of my TODO's and ready for another round of review! https://demo.rerun.io/pr/3530 is not yet live - I believe because some of the workflows require approval from a maintainer to start? |
web demo upload is sadly one of the things we can't do yet for PRs from fork since it queries a bunch of tokens that we don't want to leak to a github action that we don't own 🤔 |
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.
aaaalmost good to go. Looking really good now :)
Tested it locally on the web, works fine on Firefox & Chrome on my Mac :) |
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.
Thank you again!
All good from my side. I merged in main because we have some ci issues here that I thought we fixed there but turns out they still weren't configured correctly. @jprochazk is taking care of it right now :)
Will merge once we achieved green ci!
oh, looks like your new test actually fails on CI right now:
https://github.com/rerun-io/rerun/actions/runs/6382347518/job/17320741545?pr=3530 I suspect it failed to determine the time offset on CI? |
Thanks, yep looks like it. I pushed a commit which added some logging, but I'm not seeing it printed out (https://github.com/rerun-io/rerun/actions/runs/6384854632/job/17329151635). So seems I need to update something about the CI also to get it to print. Looking more into that... |
The test needs |
If we can't get this to work on CI I'm very much open to disabling the test since clearly it worked on a variety of systems. But we should probably make the "local time" option greyed out in the ui if we know it's not available, we can do so in a follow-up |
Makes sense, thanks. I removed the test (that's what you meant by disable, right?) and in a follow-up will disable the radio boxes if we fail to get the local timezone. |
commented out or something would have been fine, but this will do. Waiting for final final ci run and then we can ship this as part of 0.9 later this week 😄 |
What
Adds the option to display timestamps in the local system timezone, addressing #1714.
rerun_local_time.mov
Checklist