mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 22:21:51 +00:00
feat(nui): Display slow queries with yellow text color
This commit is contained in:
1 parent
31fb361c4c
commit
b0ea8e1172
2 files changed
+15
-2
No files matched your search
+7
-1
@@ -5,6 +5,7 @@ interface QueryData {
|
||||
date: number;
|
||||
query: string;
|
||||
executionTime: number;
|
||||
slow?: boolean;
|
||||
}
|
||||
|
||||
type QueryLog = Record<string, QueryData[]>;
|
||||
@@ -21,7 +22,12 @@ export const logQuery = (invokingResource: string, query: string, executionTime:
|
||||
if (!mysql_ui) return;
|
||||
|
||||
if (logStorage[invokingResource] === undefined) logStorage[invokingResource] = [];
|
||||
logStorage[invokingResource].push({ query, executionTime, date: Date.now() });
|
||||
logStorage[invokingResource].push({
|
||||
query,
|
||||
executionTime,
|
||||
date: Date.now(),
|
||||
slow: executionTime >= mysql_slow_query_warning ? true : undefined,
|
||||
});
|
||||
};
|
||||
|
||||
RegisterCommand(
|
||||
|
||||
Reference in new issue
Block a user