Set the dafault refresh rate of system stats to 60 seconds

This commit is contained in:
Nicolas Hennion 2021-05-28 17:54:34 +02:00
parent b85c1aba82
commit 99814a8ca8
4 changed files with 17 additions and 1 deletions

View File

@ -44,6 +44,14 @@ swap_careful=50
swap_warning=70
swap_critical=90
[system]
# This plugin display the first line in the Glances UI with:
# Hostname / Operating system name / Architecture information
# Set to true to disable a plugin
disable=False
# Default refresh rate is 60 seconds
#refresh=60
[cpu]
disable=False
# See https://scoutapm.com/blog/slow_server_flow_chart

View File

@ -29,7 +29,7 @@ import sys
# Global name
# Version should start and end with a numerical char
# See https://packaging.python.org/specifications/core-metadata/#version
__version__ = '3.1.8b7'
__version__ = '3.1.8b8'
__author__ = 'Nicolas Hennion <nicolas@nicolargo.com>'
__license__ = 'LGPLv3'

View File

@ -587,6 +587,10 @@ class GlancesPlugin(object):
"""Set the limits to input_limits."""
self._limits = input_limits
def set_limits(self, item, value):
"""Return the limits object."""
self._limits[item] = value
def get_limits(self, item=None):
"""Return the limits object."""
if item is None:

View File

@ -90,6 +90,10 @@ class Plugin(GlancesPlugin):
# We want to display the stat in the curse interface
self.display_curse = True
# Set default rate to 60 seconds
if self.get_limits('refresh') is None:
self.set_limits('refresh', 60)
@GlancesPlugin._check_decorator
@GlancesPlugin._log_result_decorator
def update(self):