Repository: hive Updated Branches: refs/heads/master 97f7d7b18 -> ed8cc8aa8
HIVE-15123: LLAP UI: The UI should work even if the cache is disabled (Gopal V, reviewed by Siddharth Seth) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/ed8cc8aa Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/ed8cc8aa Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/ed8cc8aa Branch: refs/heads/master Commit: ed8cc8aa807ed4cc52b20eaf1274b52d530bba3a Parents: 97f7d7b Author: Gopal V <gop...@apache.org> Authored: Fri Nov 4 16:04:15 2016 -0700 Committer: Gopal V <gop...@apache.org> Committed: Fri Nov 4 16:04:15 2016 -0700 ---------------------------------------------------------------------- .../resources/hive-webapps/llap/js/metrics.js | 26 +++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/ed8cc8aa/llap-server/src/main/resources/hive-webapps/llap/js/metrics.js ---------------------------------------------------------------------- diff --git a/llap-server/src/main/resources/hive-webapps/llap/js/metrics.js b/llap-server/src/main/resources/hive-webapps/llap/js/metrics.js index b67a6e3..7bb2890 100644 --- a/llap-server/src/main/resources/hive-webapps/llap/js/metrics.js +++ b/llap-server/src/main/resources/hive-webapps/llap/js/metrics.js @@ -79,11 +79,19 @@ llap.model.LlapDaemonCacheMetrics = new function() { this.fill_rate = trendlist(50); this.push = function(jmx) { var bean = jmxbean(jmx, this.name); - this.cache_max = bean["CacheCapacityTotal"]/(1024*1024); - this.cache_used = bean["CacheCapacityUsed"]/(1024*1024); - this.cache_reqs = bean["CacheReadRequests"]; - this.fill_rate.add((this.cache_used*100.0)/this.cache_max); - this.hit_rate.add(bean["CacheHitRatio"]*100.0); + if (bean) { + this.cache_max = bean["CacheCapacityTotal"]/(1024*1024); + this.cache_used = bean["CacheCapacityUsed"]/(1024*1024); + this.cache_reqs = bean["CacheReadRequests"]; + this.fill_rate.add((this.cache_used*100.0)/this.cache_max); + this.hit_rate.add(bean["CacheHitRatio"]*100.0); + } else { + this.cache_max = -1; + this.cache_used = -1; + this.cache_reqs = -1; + this.fill_rate.add(0); + this.hit_rate.add(-1); + } } return this; } @@ -106,10 +114,10 @@ llap.model.LlapDaemonExecutorMetrics = new function() { this.push = function(jmx) { var bean = jmxbean(jmx, this.name); this.queue_rate.add(bean["ExecutorNumQueuedRequests"] || 0); - this.lost_time = bean["PreemptionTimeLost"]; - this.num_tasks = bean["ExecutorTotalRequestsHandled"]; - this.interrupted_tasks = bean["ExecutorTotalInterrupted"]; - this.failed_tasks = bean["ExecutorTotalExecutionFailure"]; + this.lost_time = bean["PreemptionTimeLost"] || 0; + this.num_tasks = bean["ExecutorTotalRequestsHandled"]; + this.interrupted_tasks = bean["ExecutorTotalInterrupted"] || 0; + this.failed_tasks = bean["ExecutorTotalExecutionFailure"] || 0; } return this; }