Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_basic_ctr():
context = TraceContext('string', 'string', 'string', True, True, True)
local_endpoint = Endpoint('string', 'string', 'string', 0)
remote_endpoint = Endpoint('string', 'string', 'string', 0)
record = (Record(context, local_endpoint)
.start(0)
.name('string')
.set_tag('additionalProp1', 'string')
.set_tag('additionalProp2', 'string')
.set_tag('additionalProp3', 'string')
.kind('CLIENT')
.annotate('string', 0)
.remote_endpoint(remote_endpoint)
.finish(0)
)
dict_record = record.asdict()
expected = {
'traceId': 'string',
'name': 'string',
'parentId': 'string',
'id': 'string',
def __init__(self,
transport: TransportABC,
sampler: SamplerABC,
local_endpoint: Endpoint) -> None:
super().__init__()
self._records: Dict[TraceContext, Record] = {}
self._transport = transport
self._sampler = sampler
self._local_endpoint = local_endpoint
def __init__(self, queue_length: int = 100) -> None:
logger.info('Zipkin address was not provided, using stub transport')
self.records: Deque[Record] = deque(maxlen=queue_length)
def to_span(self, context: TraceContext) -> SpanAbc:
if not context.sampled:
return NoopSpan(self, context)
record = Record(context, self._local_endpoint)
self._records[context] = record
return Span(self, context, record)