# 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 logging
from oslo_serialization import jsonutils
from osprofiler.drivers import base
from osprofiler import exc
            from sqlalchemy import create_engine
            from sqlalchemy import Table, MetaData, Column
            from sqlalchemy import String, JSON, Integer
            from sqlalchemy.sql import select
            from sqlalchemy.sql import select
                project=project,
                service=service,
                host=host,
                name=name,
                data=jsonutils.dumps(data)
            )
            self._conn.execute(ins)
        except Exception:
            LOG.exception("Can not store osprofiler tracepoint {} "
                          "(base_id {})".format(trace_id, base_id))

    def list_traces(self, fields=None):
        try:
        except ImportError:
            raise exc.CommandError(
                "To use this command, you should install 'SQLAlchemy'")
        stmt = select([self._data_table])
        seen_ids = set()
        result = []
        traces = self._conn.execute(stmt).fetchall()
        for trace in traces:
            if trace["base_id"] not in seen_ids:
                seen_ids.add(trace["base_id"])
                result.append({key: value for key, value in trace.items()
                               if key in fields})
        return result

    def get_report(self, base_id):
        try:
        except ImportError:

# 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/sqlalchemy_driver.py
import logging
from oslo_serialization import jsonutils
from osprofiler.drivers import base
from osprofiler import exc
            from sqlalchemy import create_engine
            from sqlalchemy import Table, MetaData, Column
            from sqlalchemy import String, JSON, Integer
            from sqlalchemy.sql import select
            from sqlalchemy.sql import select

                project=project,
                service=service,
                host=host,
                name=name,
                data=jsonutils.dumps(data)
            )
            self._conn.execute(ins)
        except Exception:
            LOG.exception("Can not store osprofiler tracepoint {} "
                          "(base_id {})".format(trace_id, base_id))

    def list_traces(self, fields=None):
        try:
        except ImportError:
            raise exc.CommandError(
                "To use this command, you should install 'SQLAlchemy'")
        stmt = select([self._data_table])
        seen_ids = set()
        result = []
        traces = self._conn.execute(stmt).fetchall()
        for trace in traces:
            if trace["base_id"] not in seen_ids:
                seen_ids.add(trace["base_id"])
                result.append({key: value for key, value in trace.items()
                               if key in fields})
        return result

    def get_report(self, base_id):
        try:
        except ImportError:

            raise exc.CommandError(