Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

Commit

Permalink
Remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
geobeau committed Dec 28, 2018
1 parent a6db66f commit c58d82d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions biggraphite/drivers/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,6 @@ def glob_metrics(self, glob, start_time=None, end_time=None):
super(_ElasticSearchAccessor, self).glob_metrics(glob, start_time, end_time)

tracing.add_attr_to_trace("glob", str(glob))
tracing.add_attr_to_trace("time.start", str(start_time))
tracing.add_attr_to_trace("time.stop", str(end_time))

if glob == "":
return []
Expand Down Expand Up @@ -637,8 +635,6 @@ def glob_directory_names(self, glob, start_time=None, end_time=None):
glob, start_time, end_time
)
tracing.add_attr_to_trace("glob", str(glob))
tracing.add_attr_to_trace("time.start", str(start_time))
tracing.add_attr_to_trace("time.stop", str(end_time))

if glob == "":
return []
Expand Down
8 changes: 4 additions & 4 deletions biggraphite/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def trace(func):
return func

def tracer(self, *args, **kwargs):
_tracer = get_bg_trace(self, func)
with _tracer.span(name="%s.%s" % (self.module_name, func.__name__)):
tracer = get_bg_trace(self, func)
with tracer.span(name="%s.%s" % (self.module_name, func.__name__)):
return func(self, *args, **kwargs)
return tracer

Expand All @@ -58,7 +58,7 @@ def add_attr_to_trace(key, value):
"""Add an attribute to the current span if tracing is enabled."""
if not execution_context:
pass
_tracer = execution_context.get_opencensus_tracer()
_tracer.add_attribute_to_current_span(
tracer = execution_context.get_opencensus_tracer()
tracer.add_attribute_to_current_span(
attribute_key=key,
attribute_value=value)

0 comments on commit c58d82d

Please sign in to comment.