Skip to content
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 timestamp (wall time) information on the Event #4034

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

marcingrzejszczak
Copy link
Contributor

fixes gh-4032

Copy link
Member

@jonatan-ivanov jonatan-ivanov left a comment

Choose a reason for hiding this comment

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

I'm not sure I understand the use-case (I made a comment on the issue).


@Override
public TimeUnit getTimestampTimeUnit() {
return TimeUnit.MILLISECONDS;
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed? Can we just say in the javadocs that it is the current wall time in ms?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what I did originally. I even named the method getTimestampInMs or sth like that. With 2 methods there is no doubt about what the units are and you are able to modify it as you please. Without that you can make easy mistakes (like I did when I've forgotten that timestamp in Brave is micro not milliseconds 🤷 ). WDYT @shakuzen ?

Co-authored-by: Jonatan Ivanov <jonatan.ivanov@gmail.com>

Closes gh-4032
@jonatan-ivanov
Copy link
Member

The things I changed in the PR:

  • Rebased it on main.
  • Moved the anonymous Event classes out to a SimpleEvent class to avoid code duplication (and anonymous classes).
  • I consolidated the interface changes into a single getWallTime method. Please let me know what you think about this, we can always add a getWallTimeUnit as an extra if it will be confusing (tried to document it to make it more clear).

@jonatan-ivanov jonatan-ivanov removed the enhancement A general enhancement label Sep 7, 2023
@jonatan-ivanov jonatan-ivanov changed the title Added timestamp and timestamp unit information on the event Add timestamp (wall time) information on the Event Sep 7, 2023
@jonatan-ivanov jonatan-ivanov merged commit 3b80487 into main Sep 7, 2023
7 checks passed
@jonatan-ivanov jonatan-ivanov deleted the timestampedEvent branch September 7, 2023 23:05
izeye added a commit to izeye/micrometer that referenced this pull request Sep 25, 2023
shakuzen pushed a commit that referenced this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a timestamp to Event in Observation
2 participants