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
SpanData interface should expose abstract time interface #6395
Comments
I don't think we should add new methods to the SpanData interface, since even with default implementations there's an increased opportunity for the implementation to diverge such that Its actually simpler to convert from epoch nanos to
That should do the trick. Tested it myself and appears to work. Checkout this post for more info. Given how easy it is, I'm not inclined to add any additional syntactic sugar. Closing, but feel free to re-open if I've missed something. |
Thanks for the simplified code suggestion. What do you mean with |
|
Clear. When providing a default implementation of |
Even with default methods, it increases the likelihood of an incorrect implementation. Consider IDE autocomplete tools which automatically provide skeleton implementations of interfaces. Additionally, we have a repository convention to represent timestamps in epoch ns. Change it here and we ought to carry the pattern everywhere else. This, coupled with the minimal improvement in ergonomics makes me think its not worth it. Thanks. |
Is your feature request related to a problem? Please describe.
In the SpanData interface there are two methods that return nanos since epoch. This causes everyone to write their own conversions to something human readable.
Describe the solution you'd like
I would like and abstract object to be returned on the interface. I can imagine the methods
Instant getStart()
andInstant getEnd()
.The simplest variant would be to add these methods and have them call (implementation) something like:
Describe alternatives you've considered
Currently I'm converting to instant myself. Especially for testing purposes human readable is an essential part of success.
Additional context
n.a.
The text was updated successfully, but these errors were encountered: