CSOIreland / PxStat

Data Dissemination Management System for publishing Statistics in Open Data formats.
MIT License
34 stars 7 forks source link

[ENHANCEMENT] Rebuild Performance management to work with Linux #786

Open neilfromcork opened 1 year ago

neilfromcork commented 1 year ago

Currently the Performance Monitoring subsystem uses the PeformanceCounter in System.Diagnostics. Because this only works with Windows, we should redesign a performance monitoring system that is platform independent.

neilfromcork commented 1 year ago

Performance count example: https://stackoverflow.com/questions/62945915/asp-net-core-linux-get-cpu-usage

Performance counters with bespoke counters tutorial: https://www.youtube.com/watch?v=SqxvleC0L4g

https://learn.microsoft.com/en-us/dotnet/core/diagnostics/event-counter-perf

https://learn.microsoft.com/en-us/dotnet/core/diagnostics/metrics

https://www.meziantou.net/getting-telemetry-data-from-inside-or-outside-a-dotnet-application.htm

Use System.Diagnostics to get current processor time: https://stackoverflow.com/questions/54178660/how-to-get-cpu-usage-and-virtual-memory-for-a-process-in-net-core

Get Memory usage: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.workingset64?view=net-7.0

Example with bespoke source plus an event listener: https://www.infoworld.com/article/3700076/how-to-use-eventcounters-in-net-core.html