-
Notifications
You must be signed in to change notification settings - Fork 4
Logger metadata for duration of sampling and conversion #32
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
Is it fine to bump to manifests to
|
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.
This looks great, but raising the deployment platform requires a little thought
Package.swift
Outdated
// supported | ||
// Linux | ||
.macOS(.v11), | ||
.macOS(.v13), |
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.
Is this required because that'll be "SemVer major", i.e. would require us to tag 0.4.0
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.
If this is required, we'd need to raise all platforms accordingly.
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 can change to use a different API for the timing; but I thought that there shouldn't be uses of these old platforms due to requirement of having Swift 5.10; which looks to be supported to require Xcode 15.3 which means a requirement for macOS Sonoma?
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.
@FranzBusch what's the latest recommendation w.r.t. platform reqs?
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.
- swift-otel is macOS 13 / iOS 16
- swift-prometheus is macOS 13 / iOS 16
- Rest of the projects don't set a supported platform and rely on a default which is something very old.
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 best option right now that both reduces the burden on adopters of this package and maintainers is to define a custom availability macro and stick it on all the APIs like it was done here apple/swift-configuration@618d19d
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.
@FranzBusch but in this case that would also be "SemVer major", right? Because @vsarunas is adding time measurement to an implementation only. So the function right now is available everywhere and we'd need to restrict it, so it would "disappear"
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.
Yes that's correct. The only way around this major (or in this case minor) is to make the implementation use runtime availability checks
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.
Good point @FranzBusch . @vsarunas , would you mind if #available(...)
'ing out the measure
code (or writing another func measure
that uses DispatchTime.now().uptimeNanoseconds
that will work on all versions)?
I don't mind if you pick if #available
or adding a new measure
with better availability.
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.
Changed to use NIODeadline.now()
that is used in the rest of the code base instead.
TimeAmount.prettyPrint has also been merged to NIO apple/swift-nio#2504 , but it formats it differently time-between-samples=0 s
vs time-between-samples=0s
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!
@vsarunas thank you! needs a rebase but I also enabled auto-merge. Don't know why I don't get a button to auto update the branch |
@weissi it's a setting for the repo, you might want to update it, see https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-suggestions-to-update-pull-request-branches |
Hmm, I do have that enabled which I believe is the correct setting ![]() |
Thanks @vsarunas , released in https://github.com/apple/swift-profile-recorder/releases/tag/0.3.7 |
Then no idea... Sorry! |
Since the pull request is coming from a fork of the repository, there is a need for an explicit permissions to edit someone else's branch. It maybe that I need to enable |
Bumps macOS support to .v13 as Swift 5.10 is present.
Adds a logger metadata duration in the logs as shown in #31