Skip to content
This repository was archived by the owner on May 24, 2020. It is now read-only.

Commit

Permalink
skip taking method name from corrupt event
Browse files Browse the repository at this point in the history
  • Loading branch information
BFergerson committed Mar 19, 2017
1 parent 16a1797 commit 57101d7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dashboard/assets/jvm_mechanic_ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var host = "http://localhost:9000";
var ledgerDB = TAFFY();
var sessionDB = TAFFY();
var methodNameMap = {};
var corruptEventMap = {};

//load local storage
var desiredCapacity = 50 * 1024 * 1024; // 50MB
Expand Down Expand Up @@ -111,8 +112,13 @@ function downloadMethodNames(initialLoad) {
$.getJSON(host + "/data/event/?event_position=" + eventPositionList.toString() + "&event_size=" + eventSizeList.toString(),
function(result) {
$.each(result, function(i, event){
methodNameMap[event["eventMethodId"]] = removePackageAndClassName(event["eventMethod"]);
console.log("Added method name: " + methodNameMap[event["eventMethodId"]]);
if (event["eventType"] == "CORRUPT_EVENT") {
corruptEventMap[event["eventId"]] = event["workSessionId"];
console.log("Skipped adding method name from corrupt event!");
} else {
methodNameMap[event["eventMethodId"]] = removePackageAndClassName(event["eventMethod"]);
console.log("Added method name: " + methodNameMap[event["eventMethodId"]]);
}
});
}).always(function(result) {
//save method names
Expand All @@ -134,6 +140,7 @@ function downloadMethodNames(initialLoad) {
}

function removePackageAndClassName(fullyQuantifiedMethodName) {
if (fullyQuantifiedMethodName == null || !fullyQuantifiedMethodName.includes(".")) return fullyQuantifiedMethodName;
var methodNameArr = fullyQuantifiedMethodName.split(".");
return methodNameArr[methodNameArr.length - 1];
}

0 comments on commit 57101d7

Please sign in to comment.