This commit is contained in:
Boris Pavlovic 2014-01-12 05:17:04 +04:00
parent aa320244cc
commit d8d94883ef
5 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -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.

View File

@ -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)})

View File

@ -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

View File

@ -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)