# Path: osprofiler/_utils.py
# def split(text, strip=True):
# def binary_encode(text, encoding="utf-8"):
# def binary_decode(data, encoding="utf-8"):
# def generate_hmac(data, hmac_key):
# def signed_pack(data, hmac_key):
# def signed_unpack(data, hmac_data, hmac_keys):
# def itersubclasses(cls, _seen=None):
# def import_modules_from_package(package):
# def shorten_id(span_id):
# 
# Path: osprofiler/drivers/base.py
# LOG = logging.getLogger(__name__)
# def get_driver(connection_string, *args, **kwargs):
#     def __init__(self, connection_str, project=None, service=None, host=None,
#                  **kwargs):
#     def notify(self, info, **kwargs):
#     def get_report(self, base_id):
#     def get_name(cls):
#     def list_traces(self, fields=None):
#     def list_error_traces(self):
#     def _build_tree(nodes):
#     def _append_results(self, trace_id, parent_id, name, project, service,
#                         host, timestamp, raw_payload=None):
#     def _parse_results(self):
#         def msec(dt):
# class Driver(object):
# 
# Path: osprofiler/exc.py
# class CommandError(Exception):
# class LogInsightAPIError(Exception):
# class LogInsightLoginTimeout(Exception):
#     def __init__(self, message=None):
#     def __str__(self):


import collections
import datetime
import time
            import jaeger_client
from urllib import parse as parser
from oslo_config import cfg
from oslo_serialization import jsonutils
from osprofiler import _utils as utils
from osprofiler.drivers import base
from osprofiler import exc

        parsed_url = parser.urlparse(connection_str)
        cfg = {
            "local_agent": {
                "reporting_host": parsed_url.hostname,
                "reporting_port": parsed_url.port,
            }
        }

        # Initialize tracer for each profiler
        service_name = "{}-{}".format(project, service)
        config = jaeger_client.Config(cfg, service_name=service_name)
        self.tracer = config.initialize_tracer()

        self.spans = collections.deque()

    @classmethod
    def get_name(cls):
        return "jaeger"

    def notify(self, payload):
        if payload["name"].endswith("start"):
            timestamp = datetime.datetime.strptime(payload["timestamp"],
                                                   "%Y-%m-%dT%H:%M:%S.%f")
            epoch = datetime.datetime.utcfromtimestamp(0)
            start_time = (timestamp - epoch).total_seconds()

            # Create parent span
            child_of = self.jaeger_client.SpanContext(
                trace_id=utils.shorten_id(payload["base_id"]),

# Path: osprofiler/_utils.py
# def split(text, strip=True):
# def binary_encode(text, encoding="utf-8"):
# def binary_decode(data, encoding="utf-8"):
# def generate_hmac(data, hmac_key):
# def signed_pack(data, hmac_key):
# def signed_unpack(data, hmac_data, hmac_keys):
# def itersubclasses(cls, _seen=None):
# def import_modules_from_package(package):
# def shorten_id(span_id):
# 
# Path: osprofiler/drivers/base.py
# LOG = logging.getLogger(__name__)
# def get_driver(connection_string, *args, **kwargs):
#     def __init__(self, connection_str, project=None, service=None, host=None,
#                  **kwargs):
#     def notify(self, info, **kwargs):
#     def get_report(self, base_id):
#     def get_name(cls):
#     def list_traces(self, fields=None):
#     def list_error_traces(self):
#     def _build_tree(nodes):
#     def _append_results(self, trace_id, parent_id, name, project, service,
#                         host, timestamp, raw_payload=None):
#     def _parse_results(self):
#         def msec(dt):
# class Driver(object):
# 
# Path: osprofiler/exc.py
# class CommandError(Exception):
# class LogInsightAPIError(Exception):
# class LogInsightLoginTimeout(Exception):
#     def __init__(self, message=None):
#     def __str__(self):


# Path: osprofiler/drivers/jaeger.py
import collections
import datetime
import time
            import jaeger_client
from urllib import parse as parser
from oslo_config import cfg
from oslo_serialization import jsonutils
from osprofiler import _utils as utils
from osprofiler.drivers import base
from osprofiler import exc


        parsed_url = parser.urlparse(connection_str)
        cfg = {
            "local_agent": {
                "reporting_host": parsed_url.hostname,
                "reporting_port": parsed_url.port,
            }
        }

        # Initialize tracer for each profiler
        service_name = "{}-{}".format(project, service)
        config = jaeger_client.Config(cfg, service_name=service_name)
        self.tracer = config.initialize_tracer()

        self.spans = collections.deque()

    @classmethod
    def get_name(cls):
        return "jaeger"

    def notify(self, payload):
        if payload["name"].endswith("start"):
            timestamp = datetime.datetime.strptime(payload["timestamp"],
                                                   "%Y-%m-%dT%H:%M:%S.%f")
            epoch = datetime.datetime.utcfromtimestamp(0)
            start_time = (timestamp - epoch).total_seconds()

            # Create parent span
            child_of = self.jaeger_client.SpanContext(
                trace_id=utils.shorten_id(payload["base_id"]),

                span_id=utils.shorten_id(payload["parent_id"]),