-
Notifications
You must be signed in to change notification settings - Fork 695
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 support for vs code markers #3399
Add support for vs code markers #3399
Conversation
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.
Looks good.
Can we add some basic tests please?
I see some stuff inhttps://github.com/NuGet/NuGet.Client/blob/dev/test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/Telemetry/NuGetTelemetryServiceTests.cs, but maybe there's better places too.
Will do. |
This is how it looks like in ETW with this change. Events ending with /Start and /Stop are not sent to telemetry:
|
Added unit tests for TelemetryActivity. |
You should rebase on top of latest dev because of ce4aa78 |
@@ -59,3 +59,4 @@ | |||
[assembly: SuppressMessage("Build", "CA1062:In externally visible method 'void OutputConsoleLogger.Log(ILogMessage message)', validate parameter 'message' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument.", Justification = "<Pending>", Scope = "member", Target = "~M:NuGet.VisualStudio.Common.OutputConsoleLogger.Log(NuGet.Common.ILogMessage)")] | |||
[assembly: SuppressMessage("Build", "CA1823:Unused field 'LogEntrySource'.", Justification = "<Pending>", Scope = "member", Target = "~F:NuGet.VisualStudio.Common.OutputConsoleLogger.LogEntrySource")] | |||
[assembly: SuppressMessage("Build", "CA1063:Provide an overridable implementation of Dispose(bool) on 'OutputConsoleLogger' or mark the type as sealed. A call to Dispose(false) should only clean up native resources. A call to Dispose(true) should clean up both managed and native resources.", Justification = "<Pending>", Scope = "type", Target = "~T:NuGet.VisualStudio.Common.OutputConsoleLogger")] | |||
[assembly: SuppressMessage("Globalization", "CA1308:Normalize strings to uppercase", Justification = "Need to unify event names to be same as ones produced from telemetry.", Scope = "member", Target = "~M:NuGet.VisualStudio.NuGetVSTelemetryService.StartActivity(System.String)~System.IDisposable")] |
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 rule is getting annoying :)
I get why it's trying to promote and why it's less error prone, but there's so much infrastructure that depends normalizes to lowercase when the culture is known.
Thoughts @NuGet/nuget-client Should we disable this in a future PR?
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.
Yeah, I think it is a good candidate for repo-wide suppression 🙂
a331492
to
8ab0002
Compare
Issue
Fixes: https://github.com/NuGet/Client.Engineering/issues/302
Regression: No
Implementation
Implements a new API on
INuGetTelemeteryService
to log a telemetry marker, which is not sent as a telemetry event. Then, use the new API to emit a start code marker at the start of every activity.Testing/Validation
Tests Added: Unit tests to execute new code paths.
Reason for not adding tests: N/A
Validation: Validated that correct ETW events are emitted where expected.