rally/openstack-patches/master/keystone/0002-Added-sql-tracing.patch
Alexei Kornienko 6d44c4930d Added python clients patches
Moved nova patches to corresponding folder

Change-Id: I97ea96b720460d3c28875bc0637aa5dfd00bcac6
2013-10-18 14:20:51 +03:00

35 lines
1.2 KiB
Diff

From 6a4cda35bd19f1fd7e7d988fed592951f28801aa Mon Sep 17 00:00:00 2001
From: Alexei Kornienko <alexei.kornienko@gmail.com>
Date: Fri, 11 Oct 2013 12:30:52 +0300
Subject: [PATCH 2/3] Added sql tracing
---
keystone/openstack/common/db/sqlalchemy/session.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/keystone/openstack/common/db/sqlalchemy/session.py b/keystone/openstack/common/db/sqlalchemy/session.py
index d28227d..d8de7bf 100644
--- a/keystone/openstack/common/db/sqlalchemy/session.py
+++ b/keystone/openstack/common/db/sqlalchemy/session.py
@@ -245,6 +245,7 @@ import functools
import os.path
import re
import time
+import tomograph
from oslo.config import cfg
import six
@@ -569,6 +570,9 @@ def get_engine(sqlite_fk=False, slave_engine=False):
if engine is None:
engine = create_engine(db_uri,
sqlite_fk=sqlite_fk)
+ if engine.name != 'sqlite':
+ sqlalchemy.event.listen(engine, 'before_execute', tomograph.before_execute('nova'))
+ sqlalchemy.event.listen(engine, 'after_execute', tomograph.after_execute('nova'))
if slave_engine:
_SLAVE_ENGINE = engine
else:
--
1.8.1.2