jkabot
10/15/2018, 8:38 PMfkrauthan
10/15/2018, 8:39 PMgetPercentageCompleted
for the actual percentage...jkabot
10/15/2018, 8:40 PMfkrauthan
10/15/2018, 8:43 PMfkrauthan
10/15/2018, 8:48 PMfunction getPercentageCompleted(taskToCheck, pending = 0, total = 0) {
let percentage = 0;
try {
percentage = taskToCheck.getPercentageCompleted();
} catch(e) {
}
if (percentage === 0) {
if (total === 0) {
return 0;
}
if (pending === 0) {
return 100;
}
return 100 * (total - pending) / total;
}
}
fkrauthan
10/15/2018, 8:49 PMjkabot
10/15/2018, 8:49 PMfkrauthan
10/15/2018, 8:49 PMreturn 100 * ((total - pending) / total);
fkrauthan
10/15/2018, 8:50 PMjkabot
10/15/2018, 8:51 PMfkrauthan
10/15/2018, 8:51 PMfkrauthan
10/15/2018, 8:54 PMelse if (taskToCheck.stage === task.MapReduceStage.MAP) {
progress = 100 + getPercentageCompleted(taskToCheck, task.getPendingMapCount(), task.getTotalMapCount());
}
gives me org.mozilla.javascript.EcmaError: TypeError: Cannot find function getPendingMapCount in object
πfkrauthan
10/15/2018, 8:55 PMfkrauthan
10/15/2018, 8:57 PMfunction methodExistOrDefault(method, defaultValue) {
if (typeof method === "function") {
return method();
}
return defaultValue;
}
Kris Wood
10/15/2018, 8:58 PMEric B
10/15/2018, 9:08 PMKris Wood
10/15/2018, 9:43 PMcreece
10/15/2018, 9:48 PMEric B
10/15/2018, 9:51 PMalien4u
10/15/2018, 9:52 PMAkbeard
10/15/2018, 9:56 PMAkbeard
10/15/2018, 9:56 PMalien4u
10/15/2018, 9:57 PMAkbeard
10/15/2018, 9:57 PMAkbeard
10/15/2018, 9:58 PMAkbeard
10/15/2018, 9:58 PMalien4u
10/15/2018, 9:59 PMalien4u
10/15/2018, 10:00 PMrecord.transform(options)
Akbeard
10/15/2018, 10:00 PMAkbeard
10/15/2018, 10:00 PM