diff --git llap-server/src/main/resources/hive-webapps/llap/js/metrics.js llap-server/src/main/resources/hive-webapps/llap/js/metrics.js index b67a6e3..5b1624a 100644 --- llap-server/src/main/resources/hive-webapps/llap/js/metrics.js +++ 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; } @@ -104,12 +112,12 @@ llap.model.LlapDaemonExecutorMetrics = new function() { this.name = "Hadoop:service=LlapDaemon,name=LlapDaemonExecutorMetrics"; this.queue_rate = trendlist(50); this.push = function(jmx) { - var bean = jmxbean(jmx, this.name); - this.queue_rate.add(bean["ExecutorNumQueuedRequests"] || 0); - this.lost_time = bean["PreemptionTimeLost"]; + var bean = jmxbean(jmx, this.name); + this.queue_rate.add(bean["ExecutorNumQueuedRequests"] || 0); + this.lost_time = bean["PreemptionTimeLost"] || 0; this.num_tasks = bean["ExecutorTotalRequestsHandled"]; - this.interrupted_tasks = bean["ExecutorTotalInterrupted"]; - this.failed_tasks = bean["ExecutorTotalExecutionFailure"]; + this.interrupted_tasks = bean["ExecutorTotalInterrupted"] || 0; + this.failed_tasks = bean["ExecutorTotalExecutionFailure"] || 0; } return this; }