summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKerim Gokarslan <kgokarsl@cisco.com>2017-09-27 16:43:36 -0700
committerKerim Gokarslan <kgokarsl@cisco.com>2017-09-27 16:43:44 -0700
commit34cbe7031415297ee5c2b6c7059801603398fa7f (patch)
tree3f4fc966ef363e80f54709429a4735eab56d6033
parenta4f1f6a51ba9a9cd8c09c49cddc577ed418ca73d (diff)
NFVBENCH-35 Runlogdate is 0 in resultnfvbench1.0.11
Change-Id: Ib062a7c655b1e2f8bd9304e32e3ffc92948c02c4 Signed-off-by: Kerim Gokarslan <kgokarsl@cisco.com>
-rw-r--r--nfvbench/nfvbench.py11
-rw-r--r--nfvbench/nfvbenchd.py13
2 files changed, 16 insertions, 8 deletions
diff --git a/nfvbench/nfvbench.py b/nfvbench/nfvbench.py
index 4256f24..84f9838 100644
--- a/nfvbench/nfvbench.py
+++ b/nfvbench/nfvbench.py
@@ -129,10 +129,13 @@ class NFVBench(object):
def prepare_summary(self, result):
"""Prepares summary of the result to print and send it to logger (eg: fluentd)"""
- sender = FluentLogHandler("resultnfvbench",
- fluentd_ip=self.config.fluentd.ip,
- fluentd_port=self.config.fluentd.port) \
- if self.config.fluentd.logging_tag else None
+ global fluent_logger
+ sender = None
+ if fluent_logger:
+ sender = FluentLogHandler("resultnfvbench",
+ fluentd_ip=self.config.fluentd.ip,
+ fluentd_port=self.config.fluentd.port)
+ sender.runlogdate = fluent_logger.runlogdate
summary = NFVBenchSummarizer(result, sender)
LOG.info(str(summary))
diff --git a/nfvbench/nfvbenchd.py b/nfvbench/nfvbenchd.py
index 4657504..1e096ae 100644
--- a/nfvbench/nfvbenchd.py
+++ b/nfvbench/nfvbenchd.py
@@ -215,10 +215,13 @@ class WebSocketIoServer(object):
self.nfvbench_runner = runner
setup_flask(http_root)
self.fluent_logger = logger
- self.result_fluent_logger = FluentLogHandler("resultnfvbench",
- fluentd_ip=self.fluent_logger.sender.host,
- fluentd_port=self.fluent_logger.sender.port) \
- if self.fluent_logger else None
+ self.result_fluent_logger = None
+ if self.fluent_logger:
+ self.result_fluent_logger = \
+ FluentLogHandler("resultnfvbench",
+ fluentd_ip=self.fluent_logger.sender.host,
+ fluentd_port=self.fluent_logger.sender.port)
+ self.result_fluent_logger.runlogdate = self.fluent_logger.runlogdate
def run(self, host='127.0.0.1', port=7556):
@@ -250,6 +253,8 @@ class WebSocketIoServer(object):
else:
# this might overwrite a previously unfetched result
Ctx.set_result(results)
+ if self.fluent_logger:
+ self.result_fluent_logger.runlogdate = self.fluent_logger.runlogdate
summary = NFVBenchSummarizer(results['result'], self.result_fluent_logger)
LOG.info(str(summary))
Ctx.release()