Open evgenyfedorov2 opened 2 months ago
@RussKie @joperezr @geeknoid @andrey-noskov - please take a look when you have time
Regarding your "con", given that we wouldn't be deleting the API and just marking it obsolete, then nobody would be 'blocked', right?
yes, please!
this probably should include ResourceMonitorService
, CircularBuffer
, Calculator
and many other internal utilities that power our IResourceMonitor
implementation.
Regarding your "con", given that we wouldn't be deleting the API and just marking it obsolete, then nobody would be 'blocked', right?
Yes.
Another question - I assume we will be able to delete any Obsolete API when .NET 8 support ends, e.g. in 2026?
@joperezr Are obsoleted APIs ever removed from the code base?
Yes, they can be. Typically that is done in the subsequent LTS version after being marked as obsoleted (in an LTS version too). This policy is documented here: https://learn.microsoft.com/en-us/dotnet/core/compatibility/api-removal
@evgenyfedorov2: sounds good to me. We can mark these API (and anything else related) as obsolete in the .NET 9 release (i.e., the dev branch). We'll also need to create migration guides.
There isn't much time before we switch to .NET 9, so we should do this before then.
Currently, ResourceMonitoring can be consumed in two ways:
BackgroundService
Both ways provide the same resource monitoring data, so essentially we have duplicated functionality. We can simplify it all by deprecating the
IResourceMonitor
API and recommend the observable instruments as the only way forward. Namely, we can deprecate following classes (or structs): src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/SystemResources.cs src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/Snapshot.cs src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/ResourceUtilization.cs src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/ISnapshotProvider.cs src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/IResourceMonitorBuilder.cs src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/IResourceMonitor.csPros:
BackgroundService
Cons:
IResourceMonitor
will be blocked in case they don't use .NET Metrics