(span)
| 74 | index = {} |
| 75 | |
| 76 | def push(span) -> None: |
| 77 | if span.get("parent_span_id") is None: |
| 78 | tree[span["id"]] = OrderedDict() |
| 79 | index[span["id"]] = tree[span["id"]] |
| 80 | elif span.get("parent_span_id") in index: |
| 81 | index[span["parent_span_id"]][span["id"]] = OrderedDict() |
| 82 | index[span["id"]] = index[span["parent_span_id"]][span["id"]] |
| 83 | else: |
| 84 | log.error("The parent span id should have been in the tracing tree.") |
| 85 | |
| 86 | for span in sorted(trace["spans"], key=lambda span: span["start_time"]): |
| 87 | push(span) |
no test coverage detected