Skip to content

Removing Windows Specifc performance counter dependency with cross platfrom EventCounters  #1924

Closed
@madhub

Description

@madhub

Currently Redis client implementation depends PerformanceCounter class to get CPU time, which brings additional Windows specific nuget package Microsoft.Win32.Registry,System.Configuration.ConfigurationManager each of these inturn brings additional packages creating dependency hell , instead of this it is better to use cross platform EventCounters .
As EventCounters is available in .NET 3.1 on wards , we can use it for .NET Core 3.1 target & older targets still use the PerformanceCounter as is.

Sample implementation of how to get cpu-usage is from Event Counter

Reference Resource

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions