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))
parser.add_argument('--log-file', '--logfile', dest='log_file',
action='store',
help='Filename for saving logs',
- metavar='<log_file>')
+ metavar='<log_file>'),
+
+ parser.add_argument('--user-label', '--userlabel', dest='user_label',
+ action='store',
+ help='Custom label for performance records')
opts, unknown_opts = parser.parse_known_args()
return opts, unknown_opts
if opts.summary:
with open(opts.summary) as json_data:
- print NFVBenchSummarizer(json.load(json_data), None)
+ result = json.load(json_data)
+ if opts.user_label:
+ result['config']['user_label'] = opts.user_label
+ print NFVBenchSummarizer(result, fluent_logger)
sys.exit(0)
# show default config in text/yaml format