Issue 467 - provide JVM heap usage as part of the progress monitor during project creation.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@2341 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Tom Morris 2011-10-21 16:28:40 +00:00
parent ff7bbc8ec0
commit 9a9f4c1354
3 changed files with 5 additions and 1 deletions

View File

@ -635,7 +635,7 @@ public class ImportingUtilities {
static public String getEncoding(JSONObject fileRecord) {
String encoding = JSONUtilities.getString(fileRecord, "encoding", null);
if (encoding == null) {
if (encoding == null || encoding.isEmpty()) {
encoding = JSONUtilities.getString(fileRecord, "declaredEncoding", null);
}
return encoding;
@ -942,5 +942,7 @@ public class ImportingUtilities {
}
JSONUtilities.safePut(progress, "message", message);
JSONUtilities.safePut(progress, "percent", percent);
JSONUtilities.safePut(progress, "memory", Runtime.getRuntime().totalMemory() / 1000000);
JSONUtilities.safePut(progress, "maxmemory", Runtime.getRuntime().maxMemory() / 1000000);
}
}

View File

@ -7,6 +7,7 @@
<tr><td colspan="3">
<button class="button" id="create-project-progress-cancel-button">Cancel</button>
<span id="create-project-progress-timing"></span>
<span id="create-project-progress-memory"></span>
</td></tr>
</table></div>
<iframe id="create-project-iframe" name="create-project-iframe"></iframe>

View File

@ -228,6 +228,7 @@ Refine.CreateProjectUI.prototype.pollImportJob = function(start, jobID, timerID,
$('#create-project-progress-timing').empty();
}
$('#create-project-progress-message').text(progress.message);
$('#create-project-progress-memory').text("Heap usage: "+progress.memory+'/'+progress.maxmemory+"MB");
}
},
"json"