示例#1
0
    def __init__(self):
        cfg = Config(config)
        init_sampler = cfg.sampler
        channel = self.local_agent_sender

        reporter = Reporter(channel=channel,
                            flush_interval=cfg.reporter_flush_interval)

        remote_sampler = RemoteControlledSampler(
            channel=channel,
            service_name=cfg.service_name,
            sampling_refresh_interval=cfg.sampling_refresh_interval,
            init_sampler=init_sampler)

        remote_tracer = Tracer(service_name=cfg.service_name,
                               reporter=reporter,
                               sampler=remote_sampler)

        const_tracer = Tracer(service_name=cfg.service_name,
                              reporter=reporter,
                              sampler=ConstSampler(decision=True))

        self._tracers = {
            SAMPLER_TYPE_CONST: const_tracer,
            SAMPLER_TYPE_REMOTE: remote_tracer
        }
    def __init__(self):
        cfg = Config(config)
        init_sampler = cfg.sampler
        channel = self.local_agent_sender

        sender = UDPSender(
            io_loop=channel.io_loop,
            host=os.getenv('AGENT_HOST', 'jaeger-agent'),
            port=cfg.local_agent_reporting_port,
        )
        reporter = Reporter(sender=sender,
                            flush_interval=cfg.reporter_flush_interval)

        remote_sampler = RemoteControlledSampler(
            channel=channel,
            service_name=cfg.service_name,
            sampling_refresh_interval=cfg.sampling_refresh_interval,
            init_sampler=init_sampler)

        remote_tracer = Tracer(service_name=cfg.service_name,
                               reporter=reporter,
                               sampler=remote_sampler)

        const_tracer = Tracer(service_name=cfg.service_name,
                              reporter=reporter,
                              sampler=ConstSampler(decision=True))

        self._tracers = {
            SAMPLER_TYPE_CONST: const_tracer,
            SAMPLER_TYPE_REMOTE: remote_tracer
        }
示例#3
0
def test_100pct_sampling_250mcs(benchmark):
    tracer = Tracer.default_tracer(channel=None,
                                   service_name='benchmark',
                                   reporter=NullReporter(),
                                   sampler=ConstSampler(True))
    # 250 micros for request execution
    benchmark(_generate_spans, tracer, sleep=0.00025)
示例#4
0
def test_all_not_batched(benchmark):
    from tchannel.sync import TChannel
    ch = TChannel(name='foo')
    f = ch.advertise(routers=["127.0.0.1:21300", "127.0.0.1:21301"])
    f.result()
    tracer = Tracer.default_tracer(ch, service_name='benchmark', sampler=ConstSampler(True))
    tracer.reporter.batch_size = 1
    # 250 micros for request execution
    benchmark(_generate_spans, tracer, sleep=0.00025)
def test_all_not_batched(benchmark):
    from tchannel.sync import TChannel
    ch = TChannel(name='foo')
    f = ch.advertise(routers=['127.0.0.1:21300', '127.0.0.1:21301'])
    f.result()
    tracer = Tracer.default_tracer(ch, service_name='benchmark', sampler=ConstSampler(True))
    tracer.reporter.batch_size = 1
    # 250 micros for request execution
    benchmark(_generate_spans, tracer, sleep=0.00025)
示例#6
0
def test_100pct_sampling(benchmark):
    tracer = Tracer.default_tracer(channel=None,
                                   service_name='benchmark',
                                   reporter=NullReporter(),
                                   sampler=ConstSampler(True))
    benchmark(_generate_spans, tracer)
def test_100pct_sampling_250mcs(benchmark):
    tracer = Tracer.default_tracer(
        channel=None, service_name='benchmark',
        reporter=NullReporter(), sampler=ConstSampler(True))
    # 250 micros for request execution
    benchmark(_generate_spans, tracer, sleep=0.00025)
def test_100pct_sampling(benchmark):
    tracer = Tracer.default_tracer(
        channel=None, service_name='benchmark',
        reporter=NullReporter(), sampler=ConstSampler(True))
    benchmark(_generate_spans, tracer)