+ if u"telemetry-show-run" not in \
+ self._data[u"tests"][self._test_id].keys():
+ self._data[u"tests"][self._test_id][u"telemetry-show-run"] = dict()
+
+ self._telemetry_msg_counter += 1
+ dut = f"dut{self._telemetry_msg_counter}"
+ runtime = {
+ u"source_type": u"node",
+ u"source_id": dut,
+ u"msg_type": u"metric",
+ u"log_level": u"INFO",
+ u"timestamp": msg.timestamp,
+ u"msg": u"show_runtime",
+ u"host": dut, # No info, should be host IP
+ u"socket": u"", # No info
+ u"data": list()
+ }
+ for line in msg.message.splitlines():
+ if not line.startswith(u"vpp_runtime_"):
+ continue
+ try:
+ params, value = line.rsplit(u" ", maxsplit=2)[:-1]
+ cut = params.index(u"{")
+ name = params[:cut].split(u"_", maxsplit=2)[-1]
+ labels = eval(
+ u"dict" + params[cut:].replace('{', '(').replace('}', ')')
+ )
+ labels[u"graph_node"] = labels.pop(u"name")
+ runtime[u"data"].append(
+ {
+ u"name": name,
+ u"value": value,
+ u"labels": labels
+ }
+ )
+ except (TypeError, ValueError, IndexError):
+ continue
+
+ self._data[u'tests'][self._test_id][u'telemetry-show-run'][dut] = \
+ copy.copy(
+ {
+ u"host": dut,
+ u"socket": u"",
+ u"runtime": runtime
+ }
+ )