Esempio n. 1
0
 def test_setter_casts_duration_ns_as_int(self):
     s = Span(tracer=None, name="test.span")
     s.duration = 3.2
     s.finish()
     assert s.duration == 3.2
     assert s.duration_ns == 3200000000
     assert isinstance(s.duration_ns, int)
Esempio n. 2
0
 def test_finish_set_span_duration(self):
     # If set the duration on a span, the span should be recorded with this
     # duration
     s = Span(tracer=None, name="test.span")
     s.duration = 1337.0
     s.finish()
     assert s.duration == 1337.0
Esempio n. 3
0
def test_finish_set_span_duration():
    # If set the duration on a span, the span should be recorded with this
    # duration
    s = Span(tracer=None, name='test.span')
    s.duration = 1337.0
    s.finish()
    assert s.duration == 1337.0
Esempio n. 4
0
def test_finish_set_span_duration():
    # If set the duration on a span, the span should be recorded with this
    # duration
    dt = DummyTracer()
    assert dt.last_span is None
    s = Span(dt, 'foo')
    s.duration = 1337.0
    s.finish()
    assert dt.last_span.duration == 1337.0