/usr/share/cagefs-skeleton/lib/python3.9/site-packages/glances
# -*- coding: utf-8 -*- # # This file is part of Glances. # # SPDX-FileCopyrightText: 2022 Nicolas Hennion <nicolas@nicolargo.com> # # SPDX-License-Identifier: LGPL-3.0-only # """The stats server manager.""" import collections from glances.stats import GlancesStats from glances.logger import logger class GlancesStatsServer(GlancesStats): """This class stores, updates and gives stats for the server.""" def __init__(self, config=None, args=None): # Init the stats super(GlancesStatsServer, self).__init__(config=config, args=args) # Init the all_stats dict used by the server # all_stats is a dict of dicts filled by the server self.all_stats = collections.defaultdict(dict) # In the update method, disable extended process stats logger.info("Disable extended processes stats in server mode") def update(self, input_stats=None): """Update the stats.""" input_stats = input_stats or {} # Force update of all the stats super(GlancesStatsServer, self).update() # Disable the extended processes stats because it cause an high CPU load self._plugins['processcount'].disable_extended() # Build all_stats variable (concatenation of all the stats) self.all_stats = self._set_stats(input_stats) def _set_stats(self, input_stats): """Set the stats to the input_stats one.""" # Build the all_stats with the get_raw() method of the plugins return {p: self._plugins[p].get_raw() for p in self._plugins if self._plugins[p].is_enabled()} def getAll(self): """Return the stats as a list.""" return self.all_stats
.
Edit
..
Edit
__init__.py
Edit
__main__.py
Edit
__pycache__
Edit
actions.py
Edit
amps
Edit
amps_list.py
Edit
attribute.py
Edit
autodiscover.py
Edit
client.py
Edit
client_browser.py
Edit
compat.py
Edit
config.py
Edit
cpu_percent.py
Edit
events.py
Edit
exports
Edit
filter.py
Edit
folder_list.py
Edit
globals.py
Edit
history.py
Edit
logger.py
Edit
main.py
Edit
outdated.py
Edit
outputs
Edit
password.py
Edit
password_list.py
Edit
plugins
Edit
ports_list.py
Edit
processes.py
Edit
programs.py
Edit
secure.py
Edit
server.py
Edit
snmp.py
Edit
standalone.py
Edit
static_list.py
Edit
stats.py
Edit
stats_client.py
Edit
stats_client_snmp.py
Edit
stats_server.py
Edit
thresholds.py
Edit
timer.py
Edit
web_list.py
Edit
webserver.py
Edit