mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 22:22:50 +00:00
refactor(database): query profiling
This commit is contained in:
1 parent
ef7f4156df
commit
197b92891a
4 files changed
+36
-10
No files matched your search
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user