|
From: <tob...@us...> - 2014-07-14 20:08:33
|
Revision: 8546
http://sourceforge.net/p/bigdata/code/8546
Author: tobycraig
Date: 2014-07-14 20:08:31 +0000 (Mon, 14 Jul 2014)
Log Message:
-----------
Added execution time to query history
Modified Paths:
--------------
branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html
branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js
Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html 2014-07-14 13:38:43 UTC (rev 8545)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html 2014-07-14 20:08:31 UTC (rev 8546)
@@ -142,6 +142,7 @@
<th>Time</th>
<th>Query</th>
<th>Results</th>
+ <th>Execution Time</th>
<th>Delete</th>
</tr>
</thead>
Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-14 13:38:43 UTC (rev 8545)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-14 20:08:31 UTC (rev 8546)
@@ -720,6 +720,7 @@
// clear the old results and set the time to now
$(row).find('.query-time').text(new Date().toISOString());
$(row).find('.query-results').text('...');
+ $(row).find('.query-execution-time').text('...');
// move it to the top
$(row).prependTo('#query-history tbody');
queryExists = true;
@@ -736,6 +737,7 @@
a.text(query);
a.html(a.html().replace(/\n/g, '<br>'));
row.append('<td class="query-results">...</td>');
+ row.append('<td class="query-execution-time">...</td>');
row.append('<td class="query-delete"><a href="#">X</a></td>')
}
@@ -900,8 +902,27 @@
$('#download-link').remove();
}
-function updateResultCount(count) {
+function updateresultCountAndExecutionTime(count) {
$('#query-history tbody tr:first td.query-results').text(count);
+
+ var ms = Date.now() - Date.parse($('#query-history tbody tr:first td.query-time').html());
+ var sec = Math.floor(ms / 1000);
+ ms = ms % 1000;
+ var min = Math.floor(sec / 60);
+ min = min % 60;
+ var hr = Math.floor(min / 60);
+ var executionTime = '';
+ if(hr > 0) {
+ executionTime += hr + 'hr, ';
+ }
+ if(min > 0) {
+ executionTime += min + 'min, ';
+ }
+ if(sec > 0) {
+ executionTime += sec + 'sec, ';
+ }
+ executionTime += ms + 'ms';
+ $('#query-history tbody tr:first td.query-execution-time').html(executionTime);
}
function showQueryResults(data) {
@@ -933,7 +954,7 @@
table.append(tr);
}
}
- updateResultCount(rows.length);
+ updateresultCountAndExecutionTime(rows.length);
} else {
// JSON
// save data for export and pagination
@@ -942,7 +963,7 @@
if(typeof(data.boolean) != 'undefined') {
// ASK query
table.append('<tr><td>' + data.boolean + '</td></tr>').addClass('boolean');
- updateResultCount('' + data.boolean);
+ updateresultCountAndExecutionTime('' + data.boolean);
return;
}
@@ -984,7 +1005,7 @@
table.append(thead);
$('#total-results').html(data.results.bindings.length);
- updateResultCount(data.results.bindings.length);
+ updateresultCountAndExecutionTime(data.results.bindings.length);
setNumberOfPages();
showPage(1);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|