提交 458b1080 编写于 作者: N nicolargo

Add timestamp to the CSV export module (issue #708)

上级 b70e916c
......@@ -8,6 +8,7 @@ Version 2.x
Enhancements and new features:
* Add process summary min/max stats (issue #703)
* Add timestamp to the CSV export module (issue #708)
* [WebUI] add "pointer" cursor for sortable columns (issue #704 from @notFloran)
Version 2.5.1
......
......@@ -22,6 +22,7 @@
# Import sys libs
import csv
import sys
import time
# Import Glances lib
from glances.core.glances_globals import is_py3
......@@ -64,13 +65,14 @@ class Export(GlancesExport):
def update(self, stats):
"""Update stats in the CSV output file."""
csv_header = []
csv_data = []
# Get the stats
all_stats = stats.getAllExports()
plugins = stats.getAllPlugins()
# Init data with timestamp (issue#708)
csv_header = ['timestamp']
csv_data = [time.strftime('%Y-%m-%d %H:%M:%S')]
# Loop over available plugin
for i, plugin in enumerate(plugins):
if plugin in self.plugins_to_export():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册