From 2cfa3a1a0ca91ba5dfabd58a1e22eaf15e57a427 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 17 Sep 2018 16:50:16 +0200 Subject: [PATCH] Give the possibility to show kernel execution time in console --- .gitignore | 1 + desktop.php | 2 ++ js/app/controllers/PlotModule.js | 7 ++++++- js/app/models/DownloadNode.js | 4 ++++ js/app/models/ExecutableNode.js | 6 +++++- php/my_config.template.php | 3 +++ 6 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 92876c5..4614d56 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ generic_data/RemoteData/ generic_data/Statistics/ generic_data/help/ generic_data/SimuTemplate/TargetsSimu.xml* +generic_data/guest* js/lib/ext help/simu help/auto diff --git a/desktop.php b/desktop.php index e71a6a9..54218fc 100644 --- a/desktop.php +++ b/desktop.php @@ -97,6 +97,8 @@ var max_uploaded_file_size = ''; var guestSessionDuration = ''; // in secs var maxGuestTimeInterval = ''; // in days + + var logExecTime = ; //create mask class (LoadMask for elements has been deprecated, use Ext.dom.Element.mask & Ext.dom.Element.unmask) var AMDAMask = new Ext.Class({ diff --git a/js/app/controllers/PlotModule.js b/js/app/controllers/PlotModule.js index c5bbf43..d30a0e1 100644 --- a/js/app/controllers/PlotModule.js +++ b/js/app/controllers/PlotModule.js @@ -64,6 +64,11 @@ Ext.define('amdaDesktop.PlotModule', { Ext.each(session.result, function (tabResult, index) { + if (logExecTime && tabResult.exectime) + { + console.log("CMD EXEC TIME FOR "+tabResult.plot+" = "+tabResult.exectime+"ms"); + } + if (tabResult.preview) { var plotPreviewConfig = { @@ -204,4 +209,4 @@ Ext.define('amdaDesktop.PlotModule', { if (!this.plotResultWindowsManager.get(winResultId)) return null; return this.plotResultWindowsManager.get(winResultId); } -}); \ No newline at end of file +}); diff --git a/js/app/models/DownloadNode.js b/js/app/models/DownloadNode.js index fb11247..1ca4a42 100644 --- a/js/app/models/DownloadNode.js +++ b/js/app/models/DownloadNode.js @@ -201,6 +201,10 @@ Ext.define('amdaModel.DownloadNode', { } return; } + + if (logExecTime && res.exectime && (res.exectime != 0)) { + console.log("CMD EXEC TIME FOR "+res.id+" = "+res.exectime+"ms"); + } var newobj = this.createJobObject(res); var newNode = Ext.create(this.get('jobNode'), diff --git a/js/app/models/ExecutableNode.js b/js/app/models/ExecutableNode.js index 336d6f2..dff2d40 100644 --- a/js/app/models/ExecutableNode.js +++ b/js/app/models/ExecutableNode.js @@ -68,13 +68,17 @@ Ext.define('amdaModel.ExecutableNode', { if (res.killed) return; - + if (isInteractivePlot){ myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id, true, function (module) { module.updateInteractiveSession(res, true); }); } else { + if (logExecTime && res.exectime && (res.exectime != 0)) { + console.log("CMD EXEC TIME FOR "+res.id+" = "+res.exectime+"ms"); + } + var newobj = this.createJobObject(res); var newNode = Ext.create(this.get('jobNode'), { info : res.info, diff --git a/php/my_config.template.php b/php/my_config.template.php index b5b1d8d..c8e5268 100644 --- a/php/my_config.template.php +++ b/php/my_config.template.php @@ -34,4 +34,7 @@ define('AMDAINTERNALDIR', '{:AMDAINTERNALDIR:}'); define('REST_API_URL', '{:REST_API_URL:}'); define('API_DOC_PATH', '{:API_DOC_PATH:}'); + +// Show log in browser console about execution time for a request +// define('LOG_EXEC_TIME', FALSE); ?> -- libgit2 0.21.2