mirror of https://github.com/nicolargo/glances
Correct an issue when stats use old stats (example network). Had also to deal with the export CSV module not working.
parent
0417762d96
commit
90b28dc633
|
@ -107,6 +107,9 @@ class Export(GlancesExport):
|
|||
# Others lines: stats
|
||||
csv_data += itervalues(all_stats[plugin])
|
||||
|
||||
logger.info(len(csv_data))
|
||||
logger.info(csv_data)
|
||||
|
||||
# Export to CSV
|
||||
# Manage header
|
||||
if self.first_line:
|
||||
|
|
|
@ -52,6 +52,7 @@ class Plugin(GlancesPlugin):
|
|||
|
||||
# We want to display the stat in the curse interface
|
||||
self.display_curse = True
|
||||
|
||||
# Hide stats if it has never been != 0
|
||||
if config is not None:
|
||||
self.hide_zero = config.get_bool_value(
|
||||
|
@ -60,6 +61,10 @@ class Plugin(GlancesPlugin):
|
|||
self.hide_zero = False
|
||||
self.hide_zero_fields = ['read_bytes', 'write_bytes']
|
||||
|
||||
# Force a first update because we need two update to have the first stat
|
||||
self.update()
|
||||
self.refresh_timer.set(0)
|
||||
|
||||
def get_key(self):
|
||||
"""Return the key of the list."""
|
||||
return 'disk_name'
|
||||
|
|
|
@ -95,6 +95,10 @@ class Plugin(GlancesPlugin):
|
|||
# value: instance of ThreadDockerGrabber
|
||||
self.thread_list = {}
|
||||
|
||||
# Force a first update because we need two update to have the first stat
|
||||
self.update()
|
||||
self.refresh_timer.set(0)
|
||||
|
||||
def exit(self):
|
||||
"""Overwrite the exit method to close threads."""
|
||||
for t in itervalues(self.thread_list):
|
||||
|
|
|
@ -60,6 +60,7 @@ class Plugin(GlancesPlugin):
|
|||
|
||||
# We want to display the stat in the curse interface
|
||||
self.display_curse = True
|
||||
|
||||
# Hide stats if it has never been != 0
|
||||
if config is not None:
|
||||
self.hide_zero = config.get_bool_value(
|
||||
|
@ -68,11 +69,15 @@ class Plugin(GlancesPlugin):
|
|||
self.hide_zero = False
|
||||
self.hide_zero_fields = ['rx', 'tx']
|
||||
|
||||
# Force a first update because we need two update to have the first stat
|
||||
self.update()
|
||||
self.refresh_timer.set(0)
|
||||
|
||||
def get_key(self):
|
||||
"""Return the key of the list."""
|
||||
return 'interface_name'
|
||||
|
||||
@GlancesPlugin._check_decorator
|
||||
# @GlancesPlugin._check_decorator
|
||||
@GlancesPlugin._log_result_decorator
|
||||
def update(self):
|
||||
"""Update network stats using the input method.
|
||||
|
|
|
@ -1013,7 +1013,7 @@ class GlancesPlugin(object):
|
|||
- if the refresh_timer is finished
|
||||
"""
|
||||
def wrapper(self, *args, **kw):
|
||||
if self.is_enable() and self.refresh_timer.finished():
|
||||
if self.is_enable() and (self.refresh_timer.finished() or self.stats == {} or self.stats == []):
|
||||
# Run the method
|
||||
ret = fct(self, *args, **kw)
|
||||
# Reset the timer
|
||||
|
|
Loading…
Reference in New Issue