Examples of MetricName


Examples of com.yammer.metrics.core.MetricName

  private final Meter _created;

  public CacheValueBufferPool(STORE store, int capacity) {
    _store = store;
    _capacity = capacity;
    _created = Metrics.newMeter(new MetricName(ORG_APACHE_BLUR, CACHE_POOL, CREATED), CREATED, TimeUnit.SECONDS);
    _reused = Metrics.newMeter(new MetricName(ORG_APACHE_BLUR, CACHE_POOL, REUSED), REUSED, TimeUnit.SECONDS);
    _detroyed = Metrics.newMeter(new MetricName(ORG_APACHE_BLUR, CACHE_POOL, DESTROYED), DESTROYED, TimeUnit.SECONDS);
  }
View Full Code Here

Examples of com.yammer.metrics.core.MetricName

    }
  }

  private BufferStore(int bufferSize, int count) {
    _bufferSize = bufferSize;
    _created = Metrics.newMeter(new MetricName(ORG_APACHE_BLUR, LUCENE, bufferSize + " " + SIZE_ALLOCATED,
        INTERNAL_BUFFERS), INTERNAL_BUFFERS, TimeUnit.SECONDS);
    _lost = Metrics.newMeter(new MetricName(ORG_APACHE_BLUR, LUCENE, bufferSize + " " + LOST, INTERNAL_BUFFERS),
        INTERNAL_BUFFERS, TimeUnit.SECONDS);
    _buffers = setupBuffers(bufferSize, count, _created);
  }
View Full Code Here

Examples of com.yammer.metrics.core.MetricName

    }
    return name;
  }

  private MetricsGroup createNewMetricsGroup(String scope) {
    MetricName readAccessName = new MetricName(ORG_APACHE_BLUR, HDFS, "Read Latency in \u00B5s", scope);
    MetricName writeAcccessName = new MetricName(ORG_APACHE_BLUR, HDFS, "Write Latency in \u00B5s", scope);
    MetricName readThroughputName = new MetricName(ORG_APACHE_BLUR, HDFS, "Read Throughput", scope);
    MetricName writeThroughputName = new MetricName(ORG_APACHE_BLUR, HDFS, "Write Throughput", scope);

    Histogram readAccess = Metrics.newHistogram(readAccessName);
    Histogram writeAccess = Metrics.newHistogram(writeAcccessName);
    Meter readThroughput = Metrics.newMeter(readThroughputName, "Read Bytes", TimeUnit.SECONDS);
    Meter writeThroughput = Metrics.newMeter(writeThroughputName, "Write Bytes", TimeUnit.SECONDS);
View Full Code Here

Examples of com.yammer.metrics.core.MetricName

      _currentFileCounter.set(Long.parseLong(_fileStatus.get().last().getPath().getName()));
    }
    removeAnyTruncatedFiles();
    loadIndexes();
    _daemon = startDaemon();
    Metrics.newGauge(new MetricName(ORG_APACHE_BLUR, HDFS_KV, SIZE, path.getParent().toString()), new Gauge<Long>() {
      @Override
      public Long value() {
        return _size.get();
      }
    });
View Full Code Here

Examples of com.yammer.metrics.core.MetricName

    _readFilter = readFilter;
    _writeFilter = writeFilter;
    _store = store;
    _cacheBlockSize = cacheBlockSize;
    _quiet = quiet;
    _hits = Metrics.newMeter(new MetricName(ORG_APACHE_BLUR, CACHE, HIT), HIT, TimeUnit.SECONDS);
    _misses = Metrics.newMeter(new MetricName(ORG_APACHE_BLUR, CACHE, MISS), MISS, TimeUnit.SECONDS);
    _evictions = Metrics.newMeter(new MetricName(ORG_APACHE_BLUR, CACHE, EVICTION), EVICTION, TimeUnit.SECONDS);
    _removals = Metrics.newMeter(new MetricName(ORG_APACHE_BLUR, CACHE, REMOVAL), REMOVAL, TimeUnit.SECONDS);
    // @TODO make configurable
    _cacheValueBufferPool = new CacheValueBufferPool(_store, 1000);
    Metrics.newGauge(new MetricName(ORG_APACHE_BLUR, CACHE, ENTRIES), new Gauge<Long>() {
      @Override
      public Long value() {
        return (long) _cacheMap.size();
      }
    });
    Metrics.newGauge(new MetricName(ORG_APACHE_BLUR, CACHE, SIZE), new Gauge<Long>() {
      @Override
      public Long value() {
        return _cacheMap.weightedSize();
      }
    });
View Full Code Here

Examples of com.yammer.metrics.core.MetricName

  public static void setupJvmMetrics() {
    final MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
    final OperatingSystemMXBean operatingSystemMXBean = ManagementFactory.getOperatingSystemMXBean();

    Metrics.newGauge(new MetricName(ORG_APACHE_BLUR, SYSTEM, LOAD_AVERAGE), new Gauge<Double>() {
      @Override
      public Double value() {
        return operatingSystemMXBean.getSystemLoadAverage();
      }
    });
    Metrics.newGauge(new MetricName(ORG_APACHE_BLUR, JVM, HEAP_USED), new Gauge<Long>() {
      @Override
      public Long value() {
        MemoryUsage usage = memoryMXBean.getHeapMemoryUsage();
        return usage.getUsed();
      }
    });
    Method processCpuTimeMethod = null;
    for (Method method : operatingSystemMXBean.getClass().getDeclaredMethods()) {
      if (method.getName().equals("getProcessCpuTime")) {
        method.setAccessible(true);
        processCpuTimeMethod = method;
      }
    }
    final double availableProcessors = operatingSystemMXBean.getAvailableProcessors();
    if (processCpuTimeMethod != null) {
      final Method pctm = processCpuTimeMethod;
      Metrics.newGauge(new MetricName(ORG_APACHE_BLUR, JVM, CPU_USED), new Gauge<Double>() {
        private long start = System.nanoTime();
        private long lastCpuTime = getProcessCputTime(pctm, operatingSystemMXBean);

        @Override
        public Double value() {
View Full Code Here

Examples of com.yammer.metrics.core.MetricName

      LOG.info("GCWatcherJdk6 was setup.");
    } else {
      _timer = null;
      LOG.warn("GCWatcherJdk6 was NOT setup.");
    }
    MetricName gcTimesName = new MetricName(ORG_APACHE_BLUR, JVM, GC_TIMES);
    _gcTimes = Metrics.newTimer(gcTimesName, TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
  }
View Full Code Here

Examples of com.yammer.metrics.core.MetricName

  private final Timer _gcTimes;

  private GCWatcherJdk7(double ratio) {
    _memoryMXBean = ManagementFactory.getMemoryMXBean();

    MetricName gcTimesName = new MetricName(ORG_APACHE_BLUR, JVM, GC_TIMES);
    _gcTimes = Metrics.newTimer(gcTimesName, TimeUnit.MILLISECONDS, TimeUnit.SECONDS);

    List<GarbageCollectorMXBean> garbageCollectorMXBeans = ManagementFactory.getGarbageCollectorMXBeans();
    for (GarbageCollectorMXBean bean : garbageCollectorMXBeans) {
      NotificationListener listener = new NotificationListener() {
View Full Code Here

Examples of com.yammer.metrics.core.MetricName

  public static <T extends Iface> T recordMethodCallsAndAverageTimes(final T t, Class<T> clazz, final boolean controller) {
    final Map<String, Histogram> histogramMap = new ConcurrentHashMap<String, Histogram>();
    Method[] declaredMethods = Iface.class.getDeclaredMethods();
    for (Method m : declaredMethods) {
      String name = m.getName();
      histogramMap.put(name, Metrics.newHistogram(new MetricName(ORG_APACHE_BLUR, BLUR, name, THRIFT_CALLS)));
    }
    final String prefix = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
    InvocationHandler handler = new InvocationHandler() {
      private final AtomicLong _requestCounter = new AtomicLong();
      private ThreadLocal<LoggerArgsState> _loggerArgsState = new ThreadLocal<LoggerArgsState>() {
View Full Code Here

Examples of com.yammer.metrics.core.MetricName

            mbeanName.append("type=").append(type);
            mbeanName.append(",keyspace=").append(keyspaceName);
            mbeanName.append(",scope=").append(columnFamilyName);
            mbeanName.append(",name=").append(metricName);

            return new MetricName(groupName, type, metricName, keyspaceName + "." + columnFamilyName, mbeanName.toString());
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.