You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the exporter, I noticed on a ZeroW it's pretty much pegging the CPU at 50% all the time. Looking at your code I can see that you're trying to gather the sensor data in a really tight loop. For my needs this isn't necessary, so I added a 10s sleep which cuts the CPU usage to essentially zero (~2% when gathering). Prometheus is only scraping every 10s anyway, so updating the sensor data more often isn't necessary.
It would be nice if this was an option, so that we can reduce CPU usage when we don't need the most up-to-date sensor data on every metrics poll.
Alternatively adding a 1s sleep in may be enough to limit CPU usage while still providing up-to-date data - it's unlikely anyone (sensible) is running Prometheus with a sub-second scrape interval.
The text was updated successfully, but these errors were encountered:
Hello,
When running the exporter, I noticed on a ZeroW it's pretty much pegging the CPU at 50% all the time. Looking at your code I can see that you're trying to gather the sensor data in a really tight loop. For my needs this isn't necessary, so I added a 10s sleep which cuts the CPU usage to essentially zero (~2% when gathering). Prometheus is only scraping every 10s anyway, so updating the sensor data more often isn't necessary.
It would be nice if this was an option, so that we can reduce CPU usage when we don't need the most up-to-date sensor data on every metrics poll.
Alternatively adding a 1s sleep in may be enough to limit CPU usage while still providing up-to-date data - it's unlikely anyone (sensible) is running Prometheus with a sub-second scrape interval.
The text was updated successfully, but these errors were encountered: