Skip to content
Snippets Groups Projects
Commit 182e72a7 authored by Erlend Ydse's avatar Erlend Ydse
Browse files

Merge branch 'dev' into 'master'

Dev

See merge request erlenyd/mysql-query-profiler!81
parents f9248df3 79e55cd2
No related branches found
No related tags found
No related merge requests found
...@@ -138,15 +138,7 @@ export default function QueryRecorder() { ...@@ -138,15 +138,7 @@ export default function QueryRecorder() {
); );
const t1 = performance.now(); const t1 = performance.now();
setRecordingTime(t1 - t0); setRecordingTime(t1 - t0);
if (result.error === 'cancelled') { if (result?.error) {
updateContext(
result,
t1 - t0,
recordingLabel,
recordingColor,
'Query was cancelled'
);
} else if (result?.error) {
let error; let error;
if (result.error?.info) { if (result.error?.info) {
const errorcode = JSON.stringify( const errorcode = JSON.stringify(
...@@ -160,6 +152,8 @@ export default function QueryRecorder() { ...@@ -160,6 +152,8 @@ export default function QueryRecorder() {
2 2
); );
error = `Errorcode: ${errorcode}\n${errormsg}`; error = `Errorcode: ${errorcode}\n${errormsg}`;
} else if (result.error === 'cancelled') {
error = 'Query was cancelled';
} else { } else {
error = String(result.error); error = String(result.error);
} }
......
{ {
"name": "mysql-query-profiler", "name": "mysql-query-profiler",
"productName": "MySQL Query Profiler", "productName": "MySQL Query Profiler",
"version": "0.3.0", "version": "0.3.1",
"description": "A profiler for MySQL queries using Electron and React", "description": "A profiler for MySQL queries using Electron and React",
"main": "./main.prod.js", "main": "./main.prod.js",
"author": { "author": {
......
...@@ -12,7 +12,7 @@ export interface Recording { ...@@ -12,7 +12,7 @@ export interface Recording {
optimizerTrace?: ResultValue[][]; optimizerTrace?: ResultValue[][];
queryOutput?: QueryOutput; queryOutput?: QueryOutput;
explainAnalyze: boolean; explainAnalyze: boolean;
explainAnalyzeTree: ExplainAnalyzeNode; explainAnalyzeTree?: ExplainAnalyzeNode;
error?: string; error?: string;
label: string; // On both in order to avoid having to create an 'activeRecordingListItem' label: string; // On both in order to avoid having to create an 'activeRecordingListItem'
uuid: string; uuid: string;
......
...@@ -108,16 +108,13 @@ export default class SqlManager { ...@@ -108,16 +108,13 @@ export default class SqlManager {
if (result?.error) { if (result?.error) {
stateCallback?.call(undefined, 'Error detected, aborting monitoring'); stateCallback?.call(undefined, 'Error detected, aborting monitoring');
await this.reset(); await this.reset();
stateCallback?.call(undefined, 'Getting optimizer trace');
const optimizerTrace = await this.runner.getOptimizerTrace();
stateCallback?.call(undefined, ''); stateCallback?.call(undefined, '');
return { return {
result, result,
optimizerTrace: DataProcessor.processOptimizerTrace(
optimizerTrace.results
),
error: result.error, error: result.error,
explainAnalyze: DataProcessor.processExplainAnalyze(result.results), explainAnalyze: result.results
? DataProcessor.processExplainAnalyze(result.results)
: undefined,
}; };
} }
stateCallback?.call(undefined, 'Getting optimizer trace'); stateCallback?.call(undefined, 'Getting optimizer trace');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment