def handler(conn, cursor, statement, params, context, executemany): info = {"db": {"statement": statement, "params": params}} info['tracepoint_id'] = '' # # This gets the entire stack as the tracepoint_id # curframe = inspect.currentframe() # for parframe in inspect.getouterframes(curframe): # info['tracepoint_id'] += '%s:%d:%s,' % parframe[1:4] profiler.start(name, info=info)
def test_start(self): p = profiler.init("secret", base_id="1", parent_id="2") p.start = mock.MagicMock() profiler.start("name", info="info") p.start.assert_called_once_with("name", info="info")
def test_start_not_inited(self): profiler._clean() profiler.start("name")
def handler(conn, cursor, statement, params, context, executemany): info = {"db": {"statement": statement, "params": params}} profiler.start(name, info=info)
def handler(conn, cursor, statement, params, context, executemany): info = {"db": { "statement": statement, "params": params} } profiler.start(name, info=info)