Skip to content

Conversation

drewnoakes
Copy link
Member

In automated performance regression tests, it's helpful to validate that package restore nominations are not happening more often than required. However there are no telemetry events for this operation, so we do not have a direct way to measure this.

This change adds a new TraceSource to the .NET Project System, that ETW clients can opt into. When enabled, any package restore nominations are logged, including information about the reason for the nomination.

For example, if a package version is changed:

TargetFrameworks
    .NETCoreApp,Version=v8.0
        PackageReferences
            MetadataExtractor
                Version
                    Before: 2.8.1
                    After: 2.9.0

These ETW events are off by default. We'll enable them in the lab for performance regressions, and they will allow catching regressions in the number of nominations, as well as helping to quickly identify what changes led to that nomination. There's no impact in regular use.

These item lists are often empty. Optimize the common case here.
They were only used in test code, and they don't add any value over `[]`.
We refer to name/value pairs on items as "metadata" to differentiate them from project-level properties.
In automated performance regression tests, it's helpful to validate that package restore nominations are not happening more often than required. However there are no telemetry events for this operation, so we do not have a direct way to measure this.

This change adds a new `TraceSource` to the .NET Project System, that ETW clients can opt into. When enabled, any package restore nominations are logged, including information about the reason for the nomination.

For example, if a package version is changed:

```
TargetFrameworks
    .NETCoreApp,Version=v8.0
        PackageReferences
            MetadataExtractor
                Version
                    Before: 2.8.1
                    After: 2.9.0
```

These ETW events are off by default. We'll enable them in the lab for performance regressions, and they will allow catching regressions in the number of nominations, as well as helping to quickly identify what changes led to that nomination. There's no impact in regular use.
@drewnoakes drewnoakes requested a review from a team as a code owner October 8, 2025 04:08
@drewnoakes drewnoakes added the Feature-NuGet NuGet integration including pushing it properties, project and package references, and Pack support. label Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-NuGet NuGet integration including pushing it properties, project and package references, and Pack support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant