sensu-plugins / sensu-plugins-cpu-checks

This plugin provides native CPU instrumentation for monitoring and metrics collection, including: CPU usage and metrics for user, nice, system, idle, iowait, irq, softirq, steal, and guest.
http://sensu-plugins.io
MIT License
13 stars 34 forks source link

Add alternative caching method to acquire CPU data #18

Closed axos88 closed 7 years ago

axos88 commented 7 years ago

This enables to set a cache file that will be used to save the last execution of the acuire_cpu_stats, removing the need for sleeping for a period of time to get accurate results. At the next check execution, the acquired cpu data is compared to the cached file, thus the effective period of time is the same as the check interval.

Sleeping causes problems when restarting the sensu-client, if the sleep time is over 10 seconds (the timeout to wait for the service to stop).

Pull Request Checklist

Is this in reference to an existing issue?

General

New Plugins

Purpose

Known Compatablity Issues

sstarcher commented 7 years ago

failing ci

axos88 commented 7 years ago

ah, rubocop, will fix them in a jiffy