[API Proposal]: Expose ISnapshotProvider interface and Snapshot struct #5385
Labels
api-approved
API was approved in API review, it can be implemented
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
work in progress 🚧
Background and motivation
The
Microsoft.Extensions.Diagnostics.ResourceMonitoring.ISnapshotProvider
interface is implemented three times in this repo:which confirms the interface is useful. In addition to that, in one of Microsoft internal repos we would like to implement this interface as well. Therefore, I propose to make the
ISnapshotProvider
interfacepublic
, so that everyone would benefit from that. Additionally, it will require making theSnapshot
structpublic
because theGetSnapshost()
method of theISnapshotProvider
interface returns aSnapshot
.API Proposal
API Usage
Possible to have a custom implementation of
ISnapshotProvider
which then can be manually registered in Dependency Injectionand injected into the ResourceMonitorService' constructor here https://github.com/dotnet/extensions/blob/main/src/Libraries/Microsoft.Extensions.Diagnostics.ResourceMonitoring/ResourceMonitorService.cs#L55
Alternative Designs
No response
Risks
No response
The text was updated successfully, but these errors were encountered: