fix: reduce high CPU usage - #2
Conversation
Fixed high CPU usage caused by a busy-wait loop reading lines from a JSONL file without delay. This loop was consuming up to 500% CPU by keeping it constantly occupied.
|
Hi @sasharozenson and many thanks @natesales for preparing this exporter - it looks like it has been useful to users! You may be interested to know that sfptpd on github now has a built-in OpenMetrics stats exporter. The basic functionality is modelled on sfptpd-exporter but is extended in various ways and there are some slight changes to the metrics definitions which we thought were necessary. Please do take a look, give it a try and let us know if you have any suggestions for changes. |
|
Hi @abower-amd, |
Great - look forward to hearing how you get on! You might well find you have similar issues with the built-in version - it's based on the same stats log data. The built-in version currently doesn't add extra labels with some of the details available in the logs and the Go exporter - we can add them in if they are useful! It's easy to add at this stage and better than doing it after the first release! |
|
I would also add that there is nothing stopping you running both exporters simultaneously - the RT stats are copied into a circular buffer for export but can still be written out to file as well. |
Fixed high CPU usage caused by a busy-wait loop reading lines from a JSONL file without delay. This loop was consuming up to 500% CPU by keeping it constantly occupied.