Skip to content

Retire IResourceMonitor set of API in favor of observable instruments #5414

@evgenyfedorov2

Description

@evgenyfedorov2

Currently, ResourceMonitoring can be consumed in two ways:

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.cs

Pros:

  • Simplified API
  • Improved performance, avoiding wasting resources for the BackgroundService

Cons:

  • Users of the IResourceMonitor will be blocked in case they don't use .NET Metrics

Sub-issues

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions