mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-27 19:25:27 +03:00
Export module are threaded
This commit is contained in:
parent
86b89c6294
commit
11fd967085
@ -23,6 +23,7 @@ import collections
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import threading
|
||||
|
||||
from glances.core.glances_globals import plugins_path, exports_path, sys_path
|
||||
from glances.core.glances_logging import logger
|
||||
@ -160,10 +161,17 @@ class GlancesStats(object):
|
||||
self.__update__(input_stats)
|
||||
|
||||
def export(self, input_stats={}):
|
||||
"""Export all the stats."""
|
||||
"""Export all the stats.
|
||||
Each export module is ran in a dedicated thread."""
|
||||
# threads = []
|
||||
for e in self._exports:
|
||||
logger.debug("Export stats using the %s module" % e)
|
||||
thread = threading.Thread(target=self._exports[e].update,
|
||||
args=(input_stats,))
|
||||
# threads.append(thread)
|
||||
thread.start()
|
||||
# logger.debug("Update %s stats" % p)
|
||||
self._exports[e].update(input_stats)
|
||||
# self._exports[e].update(input_stats)
|
||||
|
||||
def getAll(self):
|
||||
"""Return all the stats (list)"""
|
||||
|
Loading…
Reference in New Issue
Block a user