FAQ
Author: prasanthj
Date: Tue Mar 10 02:19:56 2015
New Revision: 1665394

URL: http://svn.apache.org/r1665394
Log:
HIVE-9890: LLAP: Provide metrics for producer/consumer queue (Prasanth Jayachandran)

Added:
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonQueueInfo.java
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonQueueMetrics.java
Removed:
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonContainerRunnerInfo.java
Modified:
     hive/branches/llap/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/LlapIoImpl.java
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/EncodedDataConsumer.java
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/OrcColumnVectorProducer.java
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/OrcEncodedDataConsumer.java
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCacheInfo.java
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCacheMetrics.java
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCustomMetricsInfo.java
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonExecutorInfo.java
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonExecutorMetrics.java
     hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/MetricsUtils.java

Modified: hive/branches/llap/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java?rev=1665394&r1=1665393&r2=1665394&view=diff
==============================================================================
--- hive/branches/llap/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (original)
+++ hive/branches/llap/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java Tue Mar 10 02:19:56 2015
@@ -2033,6 +2033,10 @@ public class HiveConf extends Configurat
          "Chooses whether query fragments will run in container or in llap"),
      LLAP_OBJECT_CACHE_ENABLED("hive.llap.object.cache.enabled", true,
   "Cache objects (plans, hashtables, etc) in llap"),
+ LLAP_QUEUE_METRICS_PERCENTILE_INTERVALS("hive.llap.queue.metrics.percentiles.intervals", "",
+ "Comma-delimited set of integers denoting the desired rollover intervals (in seconds) for" +
+ "percentile latency metrics on the LLAP daemon producer-consumer queue. By default," +
+ "percentile latency metrics are disabled."),


      SPARK_CLIENT_FUTURE_TIMEOUT("hive.spark.client.future.timeout",

Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java?rev=1665394&r1=1665393&r2=1665394&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapDaemon.java Tue Mar 10 02:19:56 2015
@@ -22,7 +22,6 @@ import java.util.concurrent.atomic.Atomi

  import javax.management.ObjectName;

-import com.google.common.annotations.VisibleForTesting;
  import org.apache.hadoop.conf.Configuration;
  import org.apache.hadoop.hive.conf.HiveConf;
  import org.apache.hadoop.hive.llap.daemon.ContainerRunner;
@@ -39,6 +38,7 @@ import org.apache.hadoop.util.JvmPauseMo
  import org.apache.hadoop.util.StringUtils;
  import org.apache.log4j.Logger;

+import com.google.common.annotations.VisibleForTesting;
  import com.google.common.base.Joiner;
  import com.google.common.base.Preconditions;

@@ -119,6 +119,7 @@ public class LlapDaemon extends Abstract
      pauseMonitor.start();
      String displayName = "LlapDaemonExecutorMetrics-" + MetricsUtils.getHostName();
      String sessionId = MetricsUtils.getUUID();
+ daemonConf.set("llap.daemon.metrics.sessionid", sessionId);
      this.metrics = LlapDaemonExecutorMetrics.create(displayName, sessionId, numExecutors);
      metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
      this.llapDaemonInfoBean = MBeans.register("LlapDaemon", "LlapDaemonInfo", this);

Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/LlapIoImpl.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/LlapIoImpl.java?rev=1665394&r1=1665393&r2=1665394&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/LlapIoImpl.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/LlapIoImpl.java Tue Mar 10 02:19:56 2015
@@ -44,13 +44,12 @@ import org.apache.hadoop.hive.llap.io.de
  import org.apache.hadoop.hive.llap.io.decode.OrcColumnVectorProducer;
  import org.apache.hadoop.hive.llap.io.metadata.OrcMetadataCache;
  import org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheMetrics;
+import org.apache.hadoop.hive.llap.metrics.LlapDaemonQueueMetrics;
  import org.apache.hadoop.hive.llap.metrics.MetricsUtils;
  import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
  import org.apache.hadoop.io.NullWritable;
  import org.apache.hadoop.mapred.InputFormat;
-import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
  import org.apache.hadoop.metrics2.util.MBeans;
-import org.apache.hadoop.util.JvmPauseMonitor;

  import com.google.common.util.concurrent.ListeningExecutorService;
  import com.google.common.util.concurrent.MoreExecutors;
@@ -62,8 +61,8 @@ public class LlapIoImpl implements LlapI
    private final ColumnVectorProducer cvp;
    private final ListeningExecutorService executor;
    private final Configuration conf;
- private LlapDaemonCacheMetrics metrics;
- private JvmPauseMonitor pauseMonitor;
+ private LlapDaemonCacheMetrics cacheMetrics;
+ private LlapDaemonQueueMetrics queueMetrics;
    private ObjectName buddyAllocatorMXBean;
    private Allocator allocator;

@@ -76,10 +75,15 @@ public class LlapIoImpl implements LlapI
      }

      String displayName = "LlapDaemonCacheMetrics-" + MetricsUtils.getHostName();
- // TODO: Find a better way to pass in session id
- String sessionId = conf.get("llap.daemon.sessionid");
- this.metrics = LlapDaemonCacheMetrics.create(displayName, sessionId);
- LOG.info("Started LlapDaemonCacheMetrics with displayName: " + displayName +
+ String sessionId = conf.get("llap.daemon.metrics.sessionid");
+ this.cacheMetrics = LlapDaemonCacheMetrics.create(displayName, sessionId);
+
+ displayName = "LlapDaemonQueueMetrics-" + MetricsUtils.getHostName();
+ int[] intervals = conf.getInts(String.valueOf(
+ HiveConf.ConfVars.LLAP_QUEUE_METRICS_PERCENTILE_INTERVALS));
+ this.queueMetrics = LlapDaemonQueueMetrics.create(displayName, sessionId, intervals);
+
+ LOG.info("Started llap daemon metrics with displayName: " + displayName +
          " sessionId: " + sessionId);

      Cache<OrcCacheKey> cache = useLowLevelCache ? null : new NoopCache<OrcCacheKey>();
@@ -88,12 +92,13 @@ public class LlapIoImpl implements LlapI
          useLrfu ? new LowLevelLrfuCachePolicy(conf) : new LowLevelFifoCachePolicy(conf);
      OrcMetadataCache metadataCache = new OrcMetadataCache();
      LowLevelCacheImpl orcCache = createLowLevelCache(
- conf, cachePolicy, metadataCache, metrics, useLowLevelCache);
+ conf, cachePolicy, metadataCache, cacheMetrics, useLowLevelCache);
      // Arbitrary thread pool. Listening is used for unhandled errors for now (TODO: remove?)
      executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(10));

      // TODO: this should depends on input format and be in a map, or something.
- this.cvp = new OrcColumnVectorProducer(metadataCache, orcCache, cache, conf, metrics);
+ this.cvp = new OrcColumnVectorProducer(metadataCache, orcCache, cache, conf, cacheMetrics,
+ queueMetrics);
      if (LOGL.isInfoEnabled()) {
        LOG.info("LLAP IO initialized");
      }
@@ -128,17 +133,17 @@ public class LlapIoImpl implements LlapI
      return new LlapInputFormat(sourceInputFormat, cvp, executor);
    }

- public LlapDaemonCacheMetrics getMetrics() {
- return metrics;
+ public LlapDaemonCacheMetrics getCacheMetrics() {
+ return cacheMetrics;
+ }
+
+ public LlapDaemonQueueMetrics getQueueMetrics() {
+ return queueMetrics;
    }

    @Override
    public void close() {
      LOG.info("Closing LlapIoImpl..");
- if (pauseMonitor != null) {
- pauseMonitor.stop();
- }
-
      if (buddyAllocatorMXBean != null) {
        MBeans.unregister(buddyAllocatorMXBean);
        buddyAllocatorMXBean = null;

Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/EncodedDataConsumer.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/EncodedDataConsumer.java?rev=1665394&r1=1665393&r2=1665394&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/EncodedDataConsumer.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/EncodedDataConsumer.java Tue Mar 10 02:19:56 2015
@@ -27,6 +27,7 @@ import org.apache.hadoop.hive.llap.Consu
  import org.apache.hadoop.hive.llap.io.api.EncodedColumnBatch;
  import org.apache.hadoop.hive.llap.io.api.EncodedColumnBatch.StreamBuffer;
  import org.apache.hadoop.hive.llap.io.api.impl.ColumnVectorBatch;
+import org.apache.hadoop.hive.llap.metrics.LlapDaemonQueueMetrics;

  /**
   *
@@ -40,10 +41,13 @@ public abstract class EncodedDataConsume
    private final Consumer<ColumnVectorBatch> downstreamConsumer;
    private Callable<Void> readCallable;
    private final int colCount;
+ private final LlapDaemonQueueMetrics queueMetrics;

- public EncodedDataConsumer(Consumer<ColumnVectorBatch> consumer, int colCount) {
+ public EncodedDataConsumer(Consumer<ColumnVectorBatch> consumer, int colCount,
+ LlapDaemonQueueMetrics queueMetrics) {
      this.downstreamConsumer = consumer;
      this.colCount = colCount;
+ this.queueMetrics = queueMetrics;
    }

    public void init(ConsumerFeedback<EncodedColumnBatch.StreamBuffer> upstreamFeedback,
@@ -70,6 +74,7 @@ public abstract class EncodedDataConsume
            pendingData.put(data.batchKey, data);
          }
        }
+ queueMetrics.setQueueSize(pendingData.size());
      }
      if (localIsStopped) {
        returnProcessed(data.columnData);
@@ -98,7 +103,10 @@ public abstract class EncodedDataConsume
        return;
      }
      if (0 == targetBatch.colsRemaining) {
+ long start = System.currentTimeMillis();
        decodeBatch(targetBatch, downstreamConsumer);
+ long end = System.currentTimeMillis();
+ queueMetrics.addProcessingTime(end - start);
        // Batch has been decoded; unlock the buffers in cache
        returnProcessed(targetBatch.columnData);
      }

Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/OrcColumnVectorProducer.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/OrcColumnVectorProducer.java?rev=1665394&r1=1665393&r2=1665394&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/OrcColumnVectorProducer.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/OrcColumnVectorProducer.java Tue Mar 10 02:19:56 2015
@@ -33,6 +33,7 @@ import org.apache.hadoop.hive.llap.io.ap
  import org.apache.hadoop.hive.llap.io.encoded.OrcEncodedDataReader;
  import org.apache.hadoop.hive.llap.io.metadata.OrcMetadataCache;
  import org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheMetrics;
+import org.apache.hadoop.hive.llap.metrics.LlapDaemonQueueMetrics;
  import org.apache.hadoop.hive.ql.io.sarg.SearchArgument;
  import org.apache.hadoop.mapred.InputSplit;

@@ -43,11 +44,12 @@ public class OrcColumnVectorProducer imp
    private final LowLevelCache lowLevelCache;
    private final Configuration conf;
    private boolean _skipCorrupt; // TODO: get rid of this
- private LlapDaemonCacheMetrics metrics;
+ private LlapDaemonCacheMetrics cacheMetrics;
+ private LlapDaemonQueueMetrics queueMetrics;

    public OrcColumnVectorProducer(OrcMetadataCache metadataCache,
        LowLevelCacheImpl lowLevelCache, Cache<OrcCacheKey> cache, Configuration conf,
- LlapDaemonCacheMetrics metrics) {
+ LlapDaemonCacheMetrics metrics, LlapDaemonQueueMetrics queueMetrics) {
      if (LlapIoImpl.LOGL.isInfoEnabled()) {
        LlapIoImpl.LOG.info("Initializing ORC column vector producer");
      }
@@ -57,7 +59,8 @@ public class OrcColumnVectorProducer imp
      this.cache = cache;
      this.conf = conf;
      this._skipCorrupt = HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_ORC_SKIP_CORRUPT_DATA);
- this.metrics = metrics;
+ this.cacheMetrics = metrics;
+ this.queueMetrics = queueMetrics;
    }

    @Override
@@ -65,9 +68,9 @@ public class OrcColumnVectorProducer imp
        Consumer<ColumnVectorBatch> consumer, InputSplit split,
        List<Integer> columnIds, SearchArgument sarg, String[] columnNames,
        QueryFragmentCounters counters) {
- metrics.incrCacheReadRequests();
+ cacheMetrics.incrCacheReadRequests();
      OrcEncodedDataConsumer edc = new OrcEncodedDataConsumer(consumer, columnIds.size(),
- _skipCorrupt, counters);
+ _skipCorrupt, counters, queueMetrics);
      OrcEncodedDataReader reader = new OrcEncodedDataReader(lowLevelCache, cache, metadataCache,
          conf, split, columnIds, sarg, columnNames, edc, counters);
      edc.init(reader, reader);

Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/OrcEncodedDataConsumer.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/OrcEncodedDataConsumer.java?rev=1665394&r1=1665393&r2=1665394&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/OrcEncodedDataConsumer.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/decode/OrcEncodedDataConsumer.java Tue Mar 10 02:19:56 2015
@@ -40,6 +40,7 @@ import org.apache.hadoop.hive.llap.io.de
  import org.apache.hadoop.hive.llap.io.decode.orc.stream.readers.TimestampStreamReader;
  import org.apache.hadoop.hive.llap.io.metadata.OrcFileMetadata;
  import org.apache.hadoop.hive.llap.io.metadata.OrcStripeMetadata;
+import org.apache.hadoop.hive.llap.metrics.LlapDaemonQueueMetrics;
  import org.apache.hadoop.hive.ql.exec.vector.ColumnVector;
  import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
  import org.apache.hadoop.hive.ql.io.orc.CompressionCodec;
@@ -58,8 +59,8 @@ public class OrcEncodedDataConsumer exte

    public OrcEncodedDataConsumer(
        Consumer<ColumnVectorBatch> consumer, int colCount, boolean skipCorrupt,
- QueryFragmentCounters counters) {
- super(consumer, colCount);
+ QueryFragmentCounters counters, LlapDaemonQueueMetrics queueMetrics) {
+ super(consumer, colCount, queueMetrics);
      this.skipCorrupt = skipCorrupt;
      this.counters = counters;
    }

Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java?rev=1665394&r1=1665393&r2=1665394&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java Tue Mar 10 02:19:56 2015
@@ -31,7 +31,6 @@ import org.apache.hadoop.hive.ql.io.orc.
  import org.apache.hadoop.hive.ql.io.orc.OrcFile;
  import org.apache.hadoop.hive.ql.io.orc.OrcInputFormat;
  import org.apache.hadoop.hive.ql.io.orc.OrcProto;
-import org.apache.hadoop.hive.ql.io.orc.OrcProto.Type;
  import org.apache.hadoop.hive.ql.io.orc.Reader;
  import org.apache.hadoop.hive.ql.io.orc.RecordReaderImpl;
  import org.apache.hadoop.hive.ql.io.orc.RecordReaderImpl.SargApplier;

Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCacheInfo.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCacheInfo.java?rev=1665394&r1=1665393&r2=1665394&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCacheInfo.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCacheInfo.java Tue Mar 10 02:19:56 2015
@@ -25,16 +25,16 @@ import com.google.common.base.Objects;
   * Metrics information for llap cache.
   */
  public enum LlapDaemonCacheInfo implements MetricsInfo {
- LLAP_DAEMON_CACHE_METRICS("Llap daemon cache related metrics"),
- CACHE_CAPACITY_REMAINING("Amount of memory available in cache in bytes"),
- CACHE_CAPACITY_TOTAL("Total amount of memory allocated for cache in bytes"),
- CACHE_CAPACITY_USED("Amount of memory used in cache in bytes"),
- CACHE_REQUESTED_BYTES("Disk ranges that are requested in bytes"),
- CACHE_HIT_BYTES("Disk ranges that are cached in bytes"),
- CACHE_HIT_RATIO("Ratio of disk ranges cached vs requested"),
- CACHE_READ_REQUESTS("Number of disk range requests to cache"),
- CACHE_ALLOCATED_ARENA("Number of arenas allocated"),
- CACHE_NUM_LOCKED_BUFFERS("Number of locked buffers in cache");
+ CacheMetrics("Llap daemon cache related metrics"),
+ CacheCapacityRemaining("Amount of memory available in cache in bytes"),
+ CacheCapacityTotal("Total amount of memory allocated for cache in bytes"),
+ CacheCapacityUsed("Amount of memory used in cache in bytes"),
+ CacheRequestedBytes("Disk ranges that are requested in bytes"),
+ CacheHitBytes("Disk ranges that are cached in bytes"),
+ CacheHitRatio("Ratio of disk ranges cached vs requested"),
+ CacheReadRequests("Number of disk range requests to cache"),
+ CacheAllocatedArena("Number of arenas allocated"),
+ CacheNumLockedBuffers("Number of locked buffers in cache");

    private final String desc;


Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCacheMetrics.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCacheMetrics.java?rev=1665394&r1=1665393&r2=1665394&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCacheMetrics.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCacheMetrics.java Tue Mar 10 02:19:56 2015
@@ -17,16 +17,16 @@
   */
  package org.apache.hadoop.hive.llap.metrics;

-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CACHE_ALLOCATED_ARENA;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CACHE_CAPACITY_REMAINING;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CACHE_CAPACITY_TOTAL;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CACHE_CAPACITY_USED;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CACHE_HIT_BYTES;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CACHE_HIT_RATIO;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CACHE_NUM_LOCKED_BUFFERS;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CACHE_READ_REQUESTS;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CACHE_REQUESTED_BYTES;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.LLAP_DAEMON_CACHE_METRICS;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CacheAllocatedArena;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CacheCapacityRemaining;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CacheCapacityTotal;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CacheCapacityUsed;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CacheHitBytes;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CacheHitRatio;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CacheNumLockedBuffers;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CacheReadRequests;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CacheRequestedBytes;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonCacheInfo.CacheMetrics;
  import static org.apache.hadoop.metrics2.impl.MsInfo.ProcessName;
  import static org.apache.hadoop.metrics2.impl.MsInfo.SessionId;

@@ -42,10 +42,9 @@ import org.apache.hadoop.metrics2.lib.Mu
  /**
   * Llap daemon cache metrics source.
   */
-@Metrics(about = "LlapDaemon Cache Metrics", context = "llap")
+@Metrics(about = "LlapDaemon Cache Metrics", context = MetricsUtils.METRICS_CONTEXT)
  public class LlapDaemonCacheMetrics implements MetricsSource {
    final String name;
- // TODO: SessionId should come from llap daemon. For now using random UUID.
    private String sessionId;
    private final MetricsRegistry registry;

@@ -68,7 +67,7 @@ public class LlapDaemonCacheMetrics impl
      this.name = name;
      this.sessionId = sessionId;
      this.registry = new MetricsRegistry("LlapDaemonCacheRegistry");
- this.registry.tag(ProcessName, "LlapDaemon").tag(SessionId, sessionId);
+ this.registry.tag(ProcessName, MetricsUtils.METRICS_PROCESS_NAME).tag(SessionId, sessionId);
    }

    public static LlapDaemonCacheMetrics create(String displayName, String sessionId) {
@@ -118,8 +117,9 @@ public class LlapDaemonCacheMetrics impl

    @Override
    public void getMetrics(MetricsCollector collector, boolean b) {
- MetricsRecordBuilder rb = collector.addRecord(LLAP_DAEMON_CACHE_METRICS)
- .setContext("llap").tag(ProcessName, "LlapDaemon")
+ MetricsRecordBuilder rb = collector.addRecord(CacheMetrics)
+ .setContext(MetricsUtils.METRICS_CONTEXT)
+ .tag(ProcessName, MetricsUtils.METRICS_PROCESS_NAME)
          .tag(SessionId, sessionId);
      getCacheStats(rb);
    }
@@ -128,15 +128,15 @@ public class LlapDaemonCacheMetrics impl
      float cacheHitRatio = cacheRequestedBytes.value() == 0 ? 0.0f :
          (float) cacheHitBytes.value() / (float) cacheRequestedBytes.value();

- rb.addCounter(CACHE_CAPACITY_REMAINING, cacheCapacityTotal.value() - cacheCapacityUsed.value())
- .addCounter(CACHE_CAPACITY_TOTAL, cacheCapacityTotal.value())
- .addCounter(CACHE_CAPACITY_USED, cacheCapacityUsed.value())
- .addCounter(CACHE_READ_REQUESTS, cacheReadRequests.value())
- .addCounter(CACHE_REQUESTED_BYTES, cacheRequestedBytes.value())
- .addCounter(CACHE_HIT_BYTES, cacheHitBytes.value())
- .addCounter(CACHE_ALLOCATED_ARENA, cacheAllocatedArena.value())
- .addCounter(CACHE_NUM_LOCKED_BUFFERS, cacheNumLockedBuffers.value())
- .addGauge(CACHE_HIT_RATIO, cacheHitRatio);
+ rb.addCounter(CacheCapacityRemaining, cacheCapacityTotal.value() - cacheCapacityUsed.value())
+ .addCounter(CacheCapacityTotal, cacheCapacityTotal.value())
+ .addCounter(CacheCapacityUsed, cacheCapacityUsed.value())
+ .addCounter(CacheReadRequests, cacheReadRequests.value())
+ .addCounter(CacheRequestedBytes, cacheRequestedBytes.value())
+ .addCounter(CacheHitBytes, cacheHitBytes.value())
+ .addCounter(CacheAllocatedArena, cacheAllocatedArena.value())
+ .addCounter(CacheNumLockedBuffers, cacheNumLockedBuffers.value())
+ .addGauge(CacheHitRatio, cacheHitRatio);
    }

  }

Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCustomMetricsInfo.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCustomMetricsInfo.java?rev=1665394&r1=1665393&r2=1665394&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCustomMetricsInfo.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonCustomMetricsInfo.java Tue Mar 10 02:19:56 2015
@@ -20,7 +20,7 @@ package org.apache.hadoop.hive.llap.metr
  import org.apache.hadoop.metrics2.MetricsInfo;

  /**
- *
+ * Custom MetricsInfo to provide custom name for the metrics.
   */
  public class LlapDaemonCustomMetricsInfo implements MetricsInfo {
    private String name;

Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonExecutorInfo.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonExecutorInfo.java?rev=1665394&r1=1665393&r2=1665394&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonExecutorInfo.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonExecutorInfo.java Tue Mar 10 02:19:56 2015
@@ -25,15 +25,15 @@ import com.google.common.base.Objects;
   * Metrics information for llap daemon container.
   */
  public enum LlapDaemonExecutorInfo implements MetricsInfo {
- LLAP_DAEMON_EXECUTOR_METRICS("Llap daemon cache related metrics"),
- EXECUTOR_THREAD_CPU_TIME("Cpu time in nanoseconds"),
- EXECUTOR_THREAD_USER_TIME("User time in nanoseconds"),
- EXECUTOR_TOTAL_REQUESTS_HANDLED("Total number of requests handled by the container"),
- EXECUTOR_NUM_QUEUED_REQUESTS("Number of requests queued by the container for processing"),
- EXECUTOR_TOTAL_SUCCESS("Total number of requests handled by the container that succeeded"),
- EXECUTOR_TOTAL_EXECUTION_FAILURE("Total number of requests handled by the container that failed execution"),
- EXECUTOR_TOTAL_INTERRUPTED("Total number of requests handled by the container that got interrupted"),
- EXECUTOR_TOTAL_ASKED_TO_DIE("Total number of requests handled by the container that were asked to die");
+ ExecutorMetrics("Llap daemon cache related metrics"),
+ ExecutorThreadCPUTime("Cpu time in nanoseconds"),
+ ExecutorThreadUserTime("User time in nanoseconds"),
+ ExecutorTotalRequestsHandled("Total number of requests handled by the container"),
+ ExecutorNumQueuedRequests("Number of requests queued by the container for processing"),
+ ExecutorTotalSuccess("Total number of requests handled by the container that succeeded"),
+ ExecutorTotalExecutionFailure("Total number of requests handled by the container that failed execution"),
+ ExecutorTotalInterrupted("Total number of requests handled by the container that got interrupted"),
+ ExecutorTotalAskedToDie("Total number of requests handled by the container that were asked to die");

    private final String desc;


Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonExecutorMetrics.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonExecutorMetrics.java?rev=1665394&r1=1665393&r2=1665394&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonExecutorMetrics.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonExecutorMetrics.java Tue Mar 10 02:19:56 2015
@@ -17,15 +17,15 @@
   */
  package org.apache.hadoop.hive.llap.metrics;

-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.EXECUTOR_NUM_QUEUED_REQUESTS;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.EXECUTOR_THREAD_CPU_TIME;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.EXECUTOR_THREAD_USER_TIME;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.EXECUTOR_TOTAL_ASKED_TO_DIE;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.EXECUTOR_TOTAL_EXECUTION_FAILURE;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.EXECUTOR_TOTAL_INTERRUPTED;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.EXECUTOR_TOTAL_REQUESTS_HANDLED;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.EXECUTOR_TOTAL_SUCCESS;
-import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.LLAP_DAEMON_EXECUTOR_METRICS;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.ExecutorNumQueuedRequests;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.ExecutorThreadCPUTime;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.ExecutorThreadUserTime;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.ExecutorTotalAskedToDie;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.ExecutorTotalExecutionFailure;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.ExecutorTotalInterrupted;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.ExecutorTotalRequestsHandled;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.ExecutorTotalSuccess;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonExecutorInfo.ExecutorMetrics;
  import static org.apache.hadoop.metrics2.impl.MsInfo.ProcessName;
  import static org.apache.hadoop.metrics2.impl.MsInfo.SessionId;

@@ -51,7 +51,7 @@ import org.apache.hadoop.metrics2.source
  /**
   * Metrics about the llap daemon executors.
   */
-@Metrics(about = "LlapDaemon Executor Metrics", context = "llap")
+@Metrics(about = "LlapDaemon Executor Metrics", context = MetricsUtils.METRICS_CONTEXT)
  public class LlapDaemonExecutorMetrics implements MetricsSource {

    private final String name;
@@ -84,7 +84,7 @@ public class LlapDaemonExecutorMetrics i
      this.jvmMetrics = jm;
      this.sessionId = sessionId;
      this.registry = new MetricsRegistry("LlapDaemonExecutorRegistry");
- this.registry.tag(ProcessName, "LlapDaemon").tag(SessionId, sessionId);
+ this.registry.tag(ProcessName, MetricsUtils.METRICS_PROCESS_NAME).tag(SessionId, sessionId);
      this.numExecutors = numExecutors;
      this.threadMXBean = ManagementFactory.getThreadMXBean();
      this.executorThreadCpuTime = new MutableGaugeLong[numExecutors];
@@ -93,10 +93,10 @@ public class LlapDaemonExecutorMetrics i
      this.userMetricsInfoMap = new ConcurrentHashMap<>();

      for (int i = 0; i < numExecutors; i++) {
- MetricsInfo mic = new LlapDaemonCustomMetricsInfo(EXECUTOR_THREAD_CPU_TIME.name() + "_" + i,
- EXECUTOR_THREAD_CPU_TIME.description());
- MetricsInfo miu = new LlapDaemonCustomMetricsInfo(EXECUTOR_THREAD_USER_TIME.name() + "_" + i,
- EXECUTOR_THREAD_USER_TIME.description());
+ MetricsInfo mic = new LlapDaemonCustomMetricsInfo(ExecutorThreadCPUTime.name() + "_" + i,
+ ExecutorThreadCPUTime.description());
+ MetricsInfo miu = new LlapDaemonCustomMetricsInfo(ExecutorThreadUserTime.name() + "_" + i,
+ ExecutorThreadUserTime.description());
        this.cpuMetricsInfoMap.put(i, mic);
        this.userMetricsInfoMap.put(i, miu);
        this.executorThreadCpuTime[i] = registry.newGauge(mic, 0L);
@@ -107,15 +107,16 @@ public class LlapDaemonExecutorMetrics i
    public static LlapDaemonExecutorMetrics create(String displayName, String sessionId,
        int numExecutors) {
      MetricsSystem ms = LlapMetricsSystem.instance();
- JvmMetrics jm = JvmMetrics.create("LlapDaemon", sessionId, ms);
+ JvmMetrics jm = JvmMetrics.create(MetricsUtils.METRICS_PROCESS_NAME, sessionId, ms);
      return ms.register(displayName, "LlapDaemon Executor Metrics",
          new LlapDaemonExecutorMetrics(displayName, jm, sessionId, numExecutors));
    }

    @Override
    public void getMetrics(MetricsCollector collector, boolean b) {
- MetricsRecordBuilder rb = collector.addRecord(LLAP_DAEMON_EXECUTOR_METRICS)
- .setContext("llap").tag(ProcessName, "LlapDaemon")
+ MetricsRecordBuilder rb = collector.addRecord(ExecutorMetrics)
+ .setContext(MetricsUtils.METRICS_CONTEXT)
+ .tag(ProcessName, MetricsUtils.METRICS_PROCESS_NAME)
          .tag(SessionId, sessionId);
      getExecutorStats(rb);
    }
@@ -151,12 +152,12 @@ public class LlapDaemonExecutorMetrics i
    private void getExecutorStats(MetricsRecordBuilder rb) {
      updateThreadMetrics(rb);

- rb.addCounter(EXECUTOR_TOTAL_REQUESTS_HANDLED, executorTotalRequestHandled.value())
- .addCounter(EXECUTOR_NUM_QUEUED_REQUESTS, executorNumQueuedRequests.value())
- .addCounter(EXECUTOR_TOTAL_SUCCESS, executorTotalSuccess.value())
- .addCounter(EXECUTOR_TOTAL_EXECUTION_FAILURE, executorTotalExecutionFailed.value())
- .addCounter(EXECUTOR_TOTAL_INTERRUPTED, executorTotalInterrupted.value())
- .addCounter(EXECUTOR_TOTAL_ASKED_TO_DIE, executorTotalAskedToDie.value());
+ rb.addCounter(ExecutorTotalRequestsHandled, executorTotalRequestHandled.value())
+ .addCounter(ExecutorNumQueuedRequests, executorNumQueuedRequests.value())
+ .addCounter(ExecutorTotalSuccess, executorTotalSuccess.value())
+ .addCounter(ExecutorTotalExecutionFailure, executorTotalExecutionFailed.value())
+ .addCounter(ExecutorTotalInterrupted, executorTotalInterrupted.value())
+ .addCounter(ExecutorTotalAskedToDie, executorTotalAskedToDie.value());
    }

    private void updateThreadMetrics(MetricsRecordBuilder rb) {

Added: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonQueueInfo.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonQueueInfo.java?rev=1665394&view=auto
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonQueueInfo.java (added)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonQueueInfo.java Tue Mar 10 02:19:56 2015
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.llap.metrics;
+
+import org.apache.hadoop.metrics2.MetricsInfo;
+
+import com.google.common.base.Objects;
+
+/**
+ * Llap daemon producer / consumer queue related metrics.
+ */
+public enum LlapDaemonQueueInfo implements MetricsInfo {
+ QueueMetrics("Llap daemon producer/consumer queue related metrics"),
+ QueueSize("Size of the queue used by producer and consumer"),
+ PercentileProcessingTime("Percentiles processing time for an element from queue"),
+ MaxProcessingTime("Max processing time for an element from queue so far");
+
+ private final String desc;
+
+ LlapDaemonQueueInfo(String desc) {
+ this.desc = desc;
+ }
+
+ @Override
+ public String description() {
+ return desc;
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this)
+ .add("name", name()).add("description", desc)
+ .toString();
+ }
+}

Added: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonQueueMetrics.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonQueueMetrics.java?rev=1665394&view=auto
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonQueueMetrics.java (added)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/LlapDaemonQueueMetrics.java Tue Mar 10 02:19:56 2015
@@ -0,0 +1,116 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.llap.metrics;
+
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonQueueInfo.MaxProcessingTime;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonQueueInfo.QueueMetrics;
+import static org.apache.hadoop.hive.llap.metrics.LlapDaemonQueueInfo.QueueSize;
+import static org.apache.hadoop.metrics2.impl.MsInfo.ProcessName;
+import static org.apache.hadoop.metrics2.impl.MsInfo.SessionId;
+
+import org.apache.hadoop.metrics2.MetricsCollector;
+import org.apache.hadoop.metrics2.MetricsRecordBuilder;
+import org.apache.hadoop.metrics2.MetricsSource;
+import org.apache.hadoop.metrics2.MetricsSystem;
+import org.apache.hadoop.metrics2.annotation.Metric;
+import org.apache.hadoop.metrics2.annotation.Metrics;
+import org.apache.hadoop.metrics2.lib.MetricsRegistry;
+import org.apache.hadoop.metrics2.lib.MutableGaugeInt;
+import org.apache.hadoop.metrics2.lib.MutableGaugeLong;
+import org.apache.hadoop.metrics2.lib.MutableQuantiles;
+import org.apache.hadoop.metrics2.lib.MutableRate;
+
+/**
+ *
+ */
+@Metrics(about = "LlapDaemon Queue Metrics", context = MetricsUtils.METRICS_CONTEXT)
+public class LlapDaemonQueueMetrics implements MetricsSource {
+ private final String name;
+ private final String sessionId;
+ private final MetricsRegistry registry;
+ private long maxTime = Long.MIN_VALUE;
+
+ @Metric
+ MutableGaugeInt queueSize;
+ @Metric
+ MutableRate rateOfProcessing;
+ final MutableQuantiles[] processingTimes;
+ @Metric
+ MutableGaugeLong maxProcessingTime;
+
+ private LlapDaemonQueueMetrics(String displayName, String sessionId, int[] intervals) {
+ this.name = displayName;
+ this.sessionId = sessionId;
+ this.registry = new MetricsRegistry("LlapDaemonQueueRegistry");
+ this.registry.tag(ProcessName, MetricsUtils.METRICS_PROCESS_NAME).tag(SessionId, sessionId);
+
+ final int len = intervals == null ? 0 : intervals.length;
+ this.processingTimes = new MutableQuantiles[len];
+ for (int i=0; i<len; i++) {
+ int interval = intervals[i];
+ processingTimes[i] = registry.newQuantiles(
+ LlapDaemonQueueInfo.PercentileProcessingTime.name() + "_" + interval + "s",
+ LlapDaemonQueueInfo.PercentileProcessingTime.description(),
+ "ops", "latency", interval);
+ }
+ }
+
+ public static LlapDaemonQueueMetrics create(String displayName, String sessionId, int[] intervals) {
+ MetricsSystem ms = LlapMetricsSystem.instance();
+ return ms.register(displayName, null, new LlapDaemonQueueMetrics(displayName, sessionId, intervals));
+ }
+
+ @Override
+ public void getMetrics(MetricsCollector collector, boolean b) {
+ MetricsRecordBuilder rb = collector.addRecord(QueueMetrics)
+ .setContext(MetricsUtils.METRICS_CONTEXT)
+ .tag(ProcessName, MetricsUtils.METRICS_PROCESS_NAME)
+ .tag(SessionId, sessionId);
+ getQueueStats(rb);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setQueueSize(int size) {
+ queueSize.set(size);
+ }
+
+ public void addProcessingTime(long latency) {
+ rateOfProcessing.add(latency);
+ if (latency > maxTime) {
+ maxTime = latency;
+ maxProcessingTime.set(maxTime);
+ }
+ for (MutableQuantiles q : processingTimes) {
+ q.add(latency);
+ }
+ }
+
+ private void getQueueStats(MetricsRecordBuilder rb) {
+ rb.addGauge(QueueSize, queueSize.value())
+ .addGauge(MaxProcessingTime, maxProcessingTime.value())
+ .addGauge(MaxProcessingTime, maxProcessingTime.value());
+ rateOfProcessing.snapshot(rb, true);
+
+ for (MutableQuantiles q : processingTimes) {
+ q.snapshot(rb, true);
+ }
+ }
+}

Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/MetricsUtils.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/MetricsUtils.java?rev=1665394&r1=1665393&r2=1665394&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/MetricsUtils.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/metrics/MetricsUtils.java Tue Mar 10 02:19:56 2015
@@ -26,6 +26,9 @@ import java.util.UUID;
   */
  public class MetricsUtils {
    private static final String LOCALHOST = "localhost";
+ public static final String METRICS_CONTEXT = "llap";
+ public static final String METRICS_PROCESS_NAME = "LlapDaemon";
+

    public static String getHostName() {
      try {

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedMar 10, '15 at 2:20a
activeMar 10, '15 at 2:20a
posts1
users1
websitehive.apache.org

1 user in discussion

Prasanthj: 1 post

People

Translate

site design / logo © 2021 Grokbase