vostok / metrics.system

Cross-platform system metrics collection for .NET Core applications.
MIT License
3 stars 2 forks source link

Fix incorrect usage of environment.processor count when collect metrics #39

Closed BroEnotiKa closed 1 year ago

BroEnotiKa commented 1 year ago

https://github.com/vostok/metrics.system/issues/38

Environment.ProcessorCount from NET6+ respects process affinity and the job object's hard limit on CPU utilization https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/environment-processorcount-on-windows

so we should get total number of system cores from NativeHostMetricsCollector_Windows instead