Fix pep
This commit is contained in:
parent
aa320244cc
commit
d8d94883ef
|
@ -16,7 +16,8 @@
|
|||
|
||||
class Notifier(object):
|
||||
"""Base notifier that should be implemented by every service that would
|
||||
like to use profiler lib."""
|
||||
like to use profiler lib.
|
||||
"""
|
||||
|
||||
def notify(self, event_type, payload):
|
||||
pass
|
||||
|
|
|
@ -24,7 +24,7 @@ __local_ctx = threading.local()
|
|||
|
||||
|
||||
def init(base_id=None, parent_id=None, service='generic'):
|
||||
""" Init profiler.
|
||||
"""Init profiler.
|
||||
:param base_id: Used to bind all related traces.
|
||||
:param parent_id: Used to build tree of traces.
|
||||
:param service: Service name that sends traces.
|
||||
|
|
|
@ -32,7 +32,7 @@ def before_execute(name):
|
|||
def after_execute():
|
||||
"""Add listener that will send trace info after sql executed."""
|
||||
def handler(conn, clauseelement, multiparams, params, result):
|
||||
p = profiler.get_profiler()
|
||||
p = profiler.get_profiler()
|
||||
if p:
|
||||
p.stop(info={"db.result": str(result)})
|
||||
|
||||
|
|
|
@ -54,4 +54,4 @@ class WsgiMiddleware(object):
|
|||
|
||||
with p(self.name, info={'url': request.url}):
|
||||
response = request.get_response(self.application)
|
||||
return response
|
||||
return response
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from osprofiler import test
|
||||
from tests import test
|
||||
|
||||
|
||||
class DummyTestCase(test.TestCase):
|
||||
|
||||
def dummy(self):
|
||||
def test_dummy(self):
|
||||
self.assertTrue(2 == 2)
|
||||
|
|
Loading…
Reference in New Issue