<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="11.0.0-preview.3.26207.106" />

System.Diagnostics.ICollectData

public interface ICollectData
Prepares performance data for the performance DLL the system loads when working with performance counters.
void CloseData()

Called by the performance DLL's close performance data function.

void CollectData(int id, IntPtr valueName, IntPtr data, int totalBytes, out IntPtr res)

Collects the performance data for the performance DLL.