Commit 2cfa3a1a0ca91ba5dfabd58a1e22eaf15e57a427
1 parent
97d270e0
Exists in
master
and in
108 other branches
Give the possibility to show kernel execution time in console
Showing
6 changed files
with
21 additions
and
2 deletions
Show diff stats
.gitignore
desktop.php
... | ... | @@ -97,6 +97,8 @@ |
97 | 97 | var max_uploaded_file_size = '<?php echo MAX_UPLOADED_FILESIZE; ?>'; |
98 | 98 | var guestSessionDuration = '<?php echo GuestSessionDuration*60; ?>'; // in secs |
99 | 99 | var maxGuestTimeInterval = '<?php echo MaxGuestTimeInterval; ?>'; // in days |
100 | + | |
101 | + var logExecTime = <?php echo (LOG_EXEC_TIME === TRUE ? 'true' : 'false'); ?>; | |
100 | 102 | |
101 | 103 | //create mask class (LoadMask for elements has been deprecated, use Ext.dom.Element.mask & Ext.dom.Element.unmask) |
102 | 104 | var AMDAMask = new Ext.Class({ | ... | ... |
js/app/controllers/PlotModule.js
... | ... | @@ -64,6 +64,11 @@ Ext.define('amdaDesktop.PlotModule', { |
64 | 64 | |
65 | 65 | |
66 | 66 | Ext.each(session.result, function (tabResult, index) { |
67 | + if (logExecTime && tabResult.exectime) | |
68 | + { | |
69 | + console.log("CMD EXEC TIME FOR "+tabResult.plot+" = "+tabResult.exectime+"ms"); | |
70 | + } | |
71 | + | |
67 | 72 | if (tabResult.preview) |
68 | 73 | { |
69 | 74 | var plotPreviewConfig = { |
... | ... | @@ -204,4 +209,4 @@ Ext.define('amdaDesktop.PlotModule', { |
204 | 209 | if (!this.plotResultWindowsManager.get(winResultId)) return null; |
205 | 210 | return this.plotResultWindowsManager.get(winResultId); |
206 | 211 | } |
207 | -}); | |
208 | 212 | \ No newline at end of file |
213 | +}); | ... | ... |
js/app/models/DownloadNode.js
... | ... | @@ -201,6 +201,10 @@ Ext.define('amdaModel.DownloadNode', { |
201 | 201 | } |
202 | 202 | return; |
203 | 203 | } |
204 | + | |
205 | + if (logExecTime && res.exectime && (res.exectime != 0)) { | |
206 | + console.log("CMD EXEC TIME FOR "+res.id+" = "+res.exectime+"ms"); | |
207 | + } | |
204 | 208 | |
205 | 209 | var newobj = this.createJobObject(res); |
206 | 210 | var newNode = Ext.create(this.get('jobNode'), | ... | ... |
js/app/models/ExecutableNode.js
... | ... | @@ -68,13 +68,17 @@ Ext.define('amdaModel.ExecutableNode', { |
68 | 68 | |
69 | 69 | if (res.killed) |
70 | 70 | return; |
71 | - | |
71 | + | |
72 | 72 | if (isInteractivePlot){ |
73 | 73 | myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id, true, function (module) { |
74 | 74 | module.updateInteractiveSession(res, true); |
75 | 75 | }); |
76 | 76 | } |
77 | 77 | else { |
78 | + if (logExecTime && res.exectime && (res.exectime != 0)) { | |
79 | + console.log("CMD EXEC TIME FOR "+res.id+" = "+res.exectime+"ms"); | |
80 | + } | |
81 | + | |
78 | 82 | var newobj = this.createJobObject(res); |
79 | 83 | var newNode = Ext.create(this.get('jobNode'), { |
80 | 84 | info : res.info, | ... | ... |
php/my_config.template.php
... | ... | @@ -34,4 +34,7 @@ define('AMDAINTERNALDIR', '{:AMDAINTERNALDIR:}'); |
34 | 34 | |
35 | 35 | define('REST_API_URL', '{:REST_API_URL:}'); |
36 | 36 | define('API_DOC_PATH', '{:API_DOC_PATH:}'); |
37 | + | |
38 | +// Show log in browser console about execution time for a request | |
39 | +// define('LOG_EXEC_TIME', FALSE); | |
37 | 40 | ?> | ... | ... |