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() {
);
const t1 = performance.now();
setRecordingTime(t1 - t0);
if (result.error === 'cancelled') {
updateContext(
result,
t1 - t0,
recordingLabel,
recordingColor,
'Query was cancelled'
);
} else if (result?.error) {
if (result?.error) {
let error;
if (result.error?.info) {
const errorcode = JSON.stringify(
......@@ -160,6 +152,8 @@ export default function QueryRecorder() {
2
);
error = `Errorcode: ${errorcode}\n${errormsg}`;
} else if (result.error === 'cancelled') {
error = 'Query was cancelled';
} else {
error = String(result.error);
}
......
{
"name": "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",
"main": "./main.prod.js",
"author": {
......
......@@ -12,7 +12,7 @@ export interface Recording {
optimizerTrace?: ResultValue[][];
queryOutput?: QueryOutput;
explainAnalyze: boolean;
explainAnalyzeTree: ExplainAnalyzeNode;
explainAnalyzeTree?: ExplainAnalyzeNode;
error?: string;
label: string; // On both in order to avoid having to create an 'activeRecordingListItem'
uuid: string;
......
......@@ -108,16 +108,13 @@ export default class SqlManager {
if (result?.error) {
stateCallback?.call(undefined, 'Error detected, aborting monitoring');
await this.reset();
stateCallback?.call(undefined, 'Getting optimizer trace');
const optimizerTrace = await this.runner.getOptimizerTrace();
stateCallback?.call(undefined, '');
return {
result,
optimizerTrace: DataProcessor.processOptimizerTrace(
optimizerTrace.results
),
error: result.error,
explainAnalyze: DataProcessor.processExplainAnalyze(result.results),
explainAnalyze: result.results
? DataProcessor.processExplainAnalyze(result.results)
: undefined,
};
}
stateCallback?.call(undefined, 'Getting optimizer trace');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment