+ 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
+ groups = re.search(self.REGEX_SH_RUN_HOST, msg.message)
+ if not groups:
+ return
+ try:
+ host = groups.group(1)
+ except (AttributeError, IndexError):
+ host = u""
+ try:
+ sock = groups.group(2)
+ except (AttributeError, IndexError):
+ sock = u""
+ runtime = {
+ u"source_type": u"node",
+ u"source_id": host,
+ u"msg_type": u"metric",
+ u"log_level": u"INFO",
+ u"timestamp": msg.timestamp,
+ u"msg": u"show_runtime",
+ u"host": host,
+ u"socket": sock,
+ u"data": list()
+ }
+ for line in msg.message.splitlines():
+ if not line.startswith(u"vpp_runtime_"):
+ continue
+ try:
+ params, value, timestamp = line.rsplit(u" ", maxsplit=2)
+ 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"timestamp": timestamp,
+ u"labels": labels
+ }
+ )
+ except (TypeError, ValueError, IndexError):
+ continue
+ self._data[u'tests'][self._test_id][u'telemetry-show-run']\
+ [f"dut{self._telemetry_msg_counter}"] = copy.copy(
+ {
+ u"host": host,
+ u"socket": sock,
+ u"runtime": runtime
+ }
+ )