-
Notifications
You must be signed in to change notification settings - Fork 37
Abstract away time source: TracingTime #86
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
Conversation
3bc22a6
to
210abc6
Compare
/// The `DispatchWallTime` at which this event occurred. | ||
public let time: DispatchWallTime | ||
/// The time at which this event occurred. | ||
public let time: TracingTime |
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.
The important part here is that even if we deprecate Span creation with this type and move to Clock, it would not have to be breaking to Tracer implementations -- they can still work without rushing to a breaking change in time type
public struct TracingTime: Sendable { | ||
enum Repr { | ||
case dispatchWallTime(DispatchWallTime) | ||
} |
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.
potentially other Clock.Instants or other time sources here...
} | ||
private var repr: Repr | ||
|
||
private init(dispatchWallTime: DispatchWallTime) { |
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.
why not public?
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 attempted to hide away dispatch completely, debatable if we care to do so or not
replaced by #98 |
Introduce a
TracingTime
type that hides the dispatch use for the time source.If we get a Clock that can do this, we can more easily move to using it in API, without breaking tracer implementations.
Kind of... Resolves #71