Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 26 additions & 37 deletions crossdock/thrift_gen/tracetest/TracedService.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 6 additions & 12 deletions crossdock/thrift_gen/tracetest/ttypes.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions jaeger_client/TUDPTransport.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ def __init__(self, host, port, blocking=False):
self.transport_host = host
self.transport_port = port
self.transport_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
if blocking:
blocking = 1
else:
blocking = 0
blocking = 1 if blocking else 0
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TUDPTransport.__init__ refactored with the following changes:

self.transport_sock.setblocking(blocking)

def write(self, buf):
Expand Down
2 changes: 1 addition & 1 deletion jaeger_client/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def new_tracer(self, io_loop=None):
if self.logging:
reporter = CompositeReporter(reporter, LoggingReporter(logger))

if not self.throttler_group() is None:
if self.throttler_group() is not None:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Config.new_tracer refactored with the following changes:

  • Simplify logical expression using De Morgan identities (de-morgan)

throttler = RemoteThrottler(
channel,
self.service_name,
Expand Down
5 changes: 1 addition & 4 deletions jaeger_client/metrics/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ def __init__(self, namespace='', service_name_label=None):
def _get_tag_name_list(self, tags):
if tags is None:
return []
tag_name_list = []
for key in tags.keys():
tag_name_list.append(key)
return tag_name_list
return [key for key in tags.keys()]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function PrometheusMetricsFactory._get_tag_name_list refactored with the following changes:


def _get_metric(self, metricType, name, tags):
if self._service_name_label:
Expand Down
3 changes: 1 addition & 2 deletions jaeger_client/rate_limiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,4 @@ def _update_balance(self):
elapsed_time = current_time - self.last_tick
self.last_tick = current_time
self.balance += elapsed_time * self.credits_per_second
if self.balance > self.max_balance:
self.balance = self.max_balance
self.balance = min(self.balance, self.max_balance)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function RateLimiter._update_balance refactored with the following changes:

2 changes: 1 addition & 1 deletion jaeger_client/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_spans(self):
class LoggingReporter(NullReporter):
"""Logs all spans."""
def __init__(self, logger=None):
self.logger = logger if logger else default_logger
self.logger = logger or default_logger
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function LoggingReporter.__init__ refactored with the following changes:


def report_span(self, span):
self.logger.info('Reporting span %s', span)
Expand Down
12 changes: 8 additions & 4 deletions jaeger_client/span.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,15 @@ def _set_sampling_priority(self, value):

def log_kv(self, key_values, timestamp=None):
if self.is_sampled():
timestamp = timestamp if timestamp else time.time()
timestamp = timestamp or time.time()
# TODO handle exception logging, 'python.exception.type' etc.
log = thrift.make_log(
timestamp=timestamp if timestamp else time.time(),
timestamp=timestamp or time.time(),
fields=key_values,
max_length=self._tracer.max_tag_value_length,
max_traceback_length=self._tracer.max_traceback_length,
)

Comment on lines -127 to +135
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Span.log_kv refactored with the following changes:

with self.update_lock:
self.logs.append(log)
return self
Expand Down Expand Up @@ -165,8 +166,11 @@ def is_debug(self):
def is_rpc(self):
for tag in self.tags:
if tag.key == ext_tags.SPAN_KIND:
return tag.vStr == ext_tags.SPAN_KIND_RPC_CLIENT or \
tag.vStr == ext_tags.SPAN_KIND_RPC_SERVER
return tag.vStr in [
ext_tags.SPAN_KIND_RPC_CLIENT,
ext_tags.SPAN_KIND_RPC_SERVER,
]

Comment on lines -168 to +173
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Span.is_rpc refactored with the following changes:

return False

def is_rpc_client(self):
Expand Down
18 changes: 11 additions & 7 deletions jaeger_client/thrift.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,19 @@ def make_ref_type(span_ref_type):
def make_references(references):
if not references:
return None
list_of_span_refs = list()
for span_ref in references:
list_of_span_refs.append(ttypes.SpanRef(
return [
ttypes.SpanRef(
refType=make_ref_type(span_ref.type),
traceIdLow=id_to_int(_id_to_low(span_ref.referenced_context.trace_id)),
traceIdHigh=id_to_int(_id_to_high(span_ref.referenced_context.trace_id)),
traceIdLow=id_to_int(
_id_to_low(span_ref.referenced_context.trace_id)
),
traceIdHigh=id_to_int(
_id_to_high(span_ref.referenced_context.trace_id)
),
spanId=id_to_int(span_ref.referenced_context.span_id),
))
return list_of_span_refs
)
for span_ref in references
]
Comment on lines -196 to +208
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function make_references refactored with the following changes:



def make_jaeger_batch(spans, process):
Expand Down
55 changes: 25 additions & 30 deletions jaeger_client/thrift_gen/agent/Agent.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading