imp: split perf info

This commit is contained in:
Alexandre Fayolle committed 2026-10-06 11:19:37 +02:00
1 parent 85566a51a5
commit 13ed529d71
1 file changed
+8
+8
View File
@@ -29,6 +29,14 @@ class OdooJsonFormatter(jsonlogger.JsonFormatter):
record.dbname = getattr(threading.currentThread(), 'dbname', '?') record.dbname = getattr(threading.currentThread(), 'dbname', '?')
record.request_id = getattr(threading.currentThread(), 'request_uuid', None) record.request_id = getattr(threading.currentThread(), 'request_uuid', None)
record.perf_info = getattr(record, 'perf_info', '') record.perf_info = getattr(record, 'perf_info', '')
if record.perf_info:
nb_queries, time_sql, time_python = record.perf_info.split()
time_total = str(float(time_sql) + float(time_python))
record.perf_info_nb_queries = nb_queries
record.perf_info_time_sql = time_sql
record.perf_info_time_python = time_python
record.perf_info_time_total = time_total
_super = super(OdooJsonFormatter, self) _super = super(OdooJsonFormatter, self)
return _super.add_fields(log_record, record, message_dict) return _super.add_fields(log_record, record, message_dict)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.