X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fconvert_xml_json.py;h=73469cd0257d5f251688e7d0248fabd94ddc1af0;hp=f1994df6b856e1af209c82f2932284af824a1cbd;hb=7b4dc49521908774f9eb2f5d287078cce06d8e49;hpb=c969f0ba092c4cd9b9115f414cd32442675a006f diff --git a/resources/tools/presentation/convert_xml_json.py b/resources/tools/presentation/convert_xml_json.py index f1994df6b8..73469cd025 100644 --- a/resources/tools/presentation/convert_xml_json.py +++ b/resources/tools/presentation/convert_xml_json.py @@ -195,38 +195,42 @@ def _export_test_from_xml_to_json(tid, in_data, out, template, metadata): ) # Process show runtime: - in_sh_run = deepcopy(in_data.get(u"show-run", None)) - if in_sh_run: - # Transform to openMetrics format - for key, val in in_sh_run.items(): - log_item = { - u"source_type": u"node", - u"source_id": key, - u"msg_type": u"metric", - u"log_level": u"INFO", - u"timestamp": in_data.get(u"starttime", u""), - u"msg": u"show_runtime", - u"data": list() - } - runtime = loads(val.get(u"runtime", list())) - for item in runtime: - for metric, m_data in item.items(): - if metric == u"name": - continue - for idx, m_item in enumerate(m_data): - log_item[u"data"].append( - { - u"name": metric, - u"value": m_item, - u"labels": { - u"host": val.get(u"host", u""), - u"socket": val.get(u"socket", u""), - u"graph_node": item.get(u"name", u""), - u"thread_id": str(idx) + if in_data.get(u"telemetry-show-run", None): + for item in in_data[u"telemetry-show-run"].values(): + data.add_to_list(u"log", item.get(u"runtime", dict())) + else: + in_sh_run = deepcopy(in_data.get(u"show-run", None)) + if in_sh_run: + # Transform to openMetrics format + for key, val in in_sh_run.items(): + log_item = { + u"source_type": u"node", + u"source_id": key, + u"msg_type": u"metric", + u"log_level": u"INFO", + u"timestamp": in_data.get(u"starttime", u""), + u"msg": u"show_runtime", + u"data": list() + } + runtime = loads(val.get(u"runtime", list())) + for item in runtime: + for metric, m_data in item.items(): + if metric == u"name": + continue + for idx, m_item in enumerate(m_data): + log_item[u"data"].append( + { + u"name": metric, + u"value": m_item, + u"labels": { + u"host": val.get(u"host", u""), + u"socket": val.get(u"socket", u""), + u"graph_node": item.get(u"name", u""), + u"thread_id": str(idx) + } } - } - ) - data.add_to_list(u"log", log_item) + ) + data.add_to_list(u"log", log_item) # Process results: results = dict()