mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-10-22 08:19:04 +00:00
perf: 优化 api sql 查询
This commit is contained in:
@@ -60,12 +60,6 @@ def on_request_finished_logging_db_query(sender, **kwargs):
|
||||
method = current_request.method
|
||||
path = current_request.get_full_path()
|
||||
|
||||
logger.debug(">>> [{}] {}".format(method, path))
|
||||
for name, counter in counters:
|
||||
logger.debug("Query {:3} times using {:.2f}s {}".format(
|
||||
counter.counter, counter.time, name)
|
||||
)
|
||||
|
||||
# print(">>> [{}] {}".format(method, path))
|
||||
# for table_name, queries in table_queries.items():
|
||||
# if table_name.startswith('rbac_') or table_name.startswith('auth_permission'):
|
||||
@@ -77,6 +71,12 @@ def on_request_finished_logging_db_query(sender, **kwargs):
|
||||
# continue
|
||||
# print('\t{}. {}'.format(i, sql))
|
||||
|
||||
logger.debug(">>> [{}] {}".format(method, path))
|
||||
for name, counter in counters:
|
||||
logger.debug("Query {:3} times using {:.2f}s {}".format(
|
||||
counter.counter, counter.time, name)
|
||||
)
|
||||
|
||||
on_request_finished_release_local(sender, **kwargs)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user