refactor(database): query profiling

This commit is contained in:
Linden committed 2023-07-11 18:40:03 +10:00
1 parent ef7f4156df
commit 197b92891a
4 files changed
+36 -10

No files matched your search

+6
View File
@@ -59,6 +59,10 @@ export const rawExecute = (
}
if (index === parametersLength - 1) {
const [profiler] = <RowDataPacket[]> await connection.query('SELECT SUM(DURATION) AS `duration` FROM INFORMATION_SCHEMA.PROFILING');
if (profiler[0]?.duration) logQuery(invokingResource, query, parseFloat(profiler[0].duration), parameters);
connection.release();
if (cb) {
@@ -108,3 +112,5 @@ export const rawExecute = (
console.error(error);
});
};