Beispiel #1
0
    def stop(self, span: Span) -> bool:
        assert span is self.spans[-1]

        span.finish(self.segment) and self.spans.pop()

        if len(self.spans) == 0:
            _thread_local.context = None
            agent.archive(self.segment)

        return len(self.spans) == 0
Beispiel #2
0
    def stop(self, span: Span) -> bool:
        spans = _spans()
        span.finish(self.segment)
        del spans[spans.index(span)]

        self._nspans -= 1
        if self._nspans == 0:
            _local().context = None
            agent.archive(self.segment)
            return True

        return False
Beispiel #3
0
    def stop(self, span: Span) -> bool:
        spans = _spans()
        idx = spans.index(
            span
        )  # span SHOULD now always be at end even in async-world, but just in case

        if span.finish(self.segment):
            del spans[idx]

        if len(spans) == 0:
            _local().context = None
            agent.archive(self.segment)

        return len(spans) == 0
Beispiel #4
0
    def stop(self, span: Span) -> bool:
        spans = _spans()
        span.finish(self.segment)

        try:
            spans.remove(span)
        except Exception:
            pass

        self._nspans -= 1
        if self._nspans == 0:
            agent.archive(self.segment)
            return True

        return False