Added alias parameter in query_counter

This commit is contained in:
Eloi Zalczer 2019-11-18 17:16:06 +01:00
parent 138e759161
commit d3420918cd

View File

@ -182,10 +182,10 @@ class query_counter(object):
- Some queries are ignored by default by the counter (killcursors, db.system.indexes) - Some queries are ignored by default by the counter (killcursors, db.system.indexes)
""" """
def __init__(self): def __init__(self, alias=DEFAULT_CONNECTION_NAME):
"""Construct the query_counter """Construct the query_counter
""" """
self.db = get_db() self.db = get_db(alias=alias)
self.initial_profiling_level = None self.initial_profiling_level = None
self._ctx_query_counter = 0 # number of queries issued by the context self._ctx_query_counter = 0 # number of queries issued by the context