Commit 2cfa3a1a0ca91ba5dfabd58a1e22eaf15e57a427

Authored by Benjamin Renard
1 parent 97d270e0

Give the possibility to show kernel execution time in console

.gitignore
... ... @@ -6,6 +6,7 @@ generic_data/RemoteData/
6 6 generic_data/Statistics/
7 7 generic_data/help/
8 8 generic_data/SimuTemplate/TargetsSimu.xml*
  9 +generic_data/guest*
9 10 js/lib/ext
10 11 help/simu
11 12 help/auto
... ...
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(&#39;amdaDesktop.PlotModule&#39;, {
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(&#39;amdaDesktop.PlotModule&#39;, {
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(&#39;amdaModel.DownloadNode&#39;, {
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(&#39;amdaModel.ExecutableNode&#39;, {
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(&#39;AMDAINTERNALDIR&#39;, &#39;{:AMDAINTERNALDIR:}&#39;);
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 ?>
... ...