Package org.apache.hadoop.metrics.util

Examples of org.apache.hadoop.metrics.util.MetricsTimeVaryingRate


  private MetricsTimeVaryingRate get(String key) {
    return (MetricsTimeVaryingRate) registry.get(key);
  }
  private MetricsTimeVaryingRate create(String key) {
    MetricsTimeVaryingRate newMetric = new MetricsTimeVaryingRate(key, this.registry);
    return newMetric;
  }
View Full Code Here


    MetricsTimeVaryingRate newMetric = new MetricsTimeVaryingRate(key, this.registry);
    return newMetric;
  }

  public synchronized void inc(String name, int amt) {
    MetricsTimeVaryingRate m = get(name);
    if (m == null) {
      m = create(name);
    }
    m.inc(amt);
  }
View Full Code Here

    synchronized (registry) {
      // Iterate through the registry to propogate the different rpc metrics.

      for (String metricName : registry.getKeyList() ) {
        MetricsTimeVaryingRate value = (MetricsTimeVaryingRate) registry.get(metricName);

        value.pushMetric(metricsRecord);
      }
    }
    metricsRecord.update();
  }
View Full Code Here

 
  public void setUp() {
    this.registry = new MetricsRegistry();
    this.metricsRate = new MetricsRate("metricsRate", registry, "test");
    this.intValue = new MetricsIntValue("intValue", registry, "test");
    this.varyRate = new MetricsTimeVaryingRate("varyRate", registry, "test");
    this.stats = new TestStatistics(registry);
    MetricsContext context = MetricsUtil.getContext("hbase");
    this.metricsRecord = MetricsUtil.createRecord(context, "test");
    this.metricsRecord.setTag("TestStatistics", "test");
    //context.registerUpdater(this);
View Full Code Here

                    " procesingTime= " + processingTime);
        }
        rpcMetrics.rpcQueueTime.inc(qTime);
        rpcMetrics.rpcProcessingTime.inc(processingTime);

        MetricsTimeVaryingRate m =
         (MetricsTimeVaryingRate) rpcDetailedMetrics.registry.get(call.getMethodName());
        if (m == null) {
          try {
            m = new MetricsTimeVaryingRate(call.getMethodName(),
                                                rpcDetailedMetrics.registry);
          } catch (IllegalArgumentException iae) {
            // the metrics has been registered; re-fetch the handle
            LOG.info("Error register " + call.getMethodName(), iae);
            m = (MetricsTimeVaryingRate) rpcDetailedMetrics.registry.get(
                call.getMethodName());
          }
        }
        m.inc(processingTime);

        if (verbose) log("Return: "+value);

        return new ObjectWritable(method.getReturnType(), value);
View Full Code Here

    private final MetricsLongValue lastTimestampInputProcessed;

    public SepMetrics(String recordName) {
        this.recordName = recordName;
        metricsRegistry = new MetricsRegistry();
        sepProcessingRate = new MetricsTimeVaryingRate("sepProcessed", metricsRegistry);
        lastTimestampInputProcessed = new MetricsLongValue("lastSepTimestamp", metricsRegistry);

        context = MetricsUtil.getContext("repository");
        metricsRecord = MetricsUtil.createRecord(context, recordName);
        context.registerUpdater(this);
View Full Code Here

    } else if (o instanceof MetricsTimeVaryingInt) {
        return ((MetricsTimeVaryingInt)o).getPreviousIntervalValue();
    } else if (o instanceof MetricsTimeVaryingLong) {
        return ((MetricsTimeVaryingLong)o).getPreviousIntervalValue();
    } else if (o instanceof MetricsTimeVaryingRate) {
      MetricsTimeVaryingRate or = (MetricsTimeVaryingRate) o;
      if (attributeName.endsWith(NUM_OPS)) {
          return or.getPreviousIntervalNumOps();
      } else if (attributeName.endsWith(AVG_TIME)) {
          return or.getPreviousIntervalAverageTime();
      } else if (attributeName.endsWith(MIN_TIME)) {
          return or.getMinTime();
      } else if (attributeName.endsWith(MAX_TIME)) {
          return or.getMaxTime();
      } else {
        MetricsUtil.LOG.error("Unexpected attrubute suffix");
        throw new AttributeNotFoundException();
      }
    } else if (o instanceof MetricsNonTimeRate) {
View Full Code Here

    private final String recordName;

    public RepositoryMetrics(String recordName) {
        this.recordName = recordName;
        for (Action action : Action.values()) {
            rates.put(action, new MetricsTimeVaryingRate(action.name().toLowerCase(), registry));
        }

        for (HBaseAction action : HBaseAction.values()) {
            hbaseRates.put(action, new MetricsTimeVaryingRate(action.name().toLowerCase(), registry));
        }
        lastMutationEventTimestamp = new MetricsLongValue("timestampLastMutation", registry);
        context = MetricsUtil.getContext("repository");
        metricsRecord = MetricsUtil.createRecord(context, recordName);
        context.registerUpdater(this);
View Full Code Here

    private final String recordName;

    public LinkIndexMetrics(String recordName) {
        this.recordName = recordName;
        for (Action action : Action.values()) {
            rates.put(action, new MetricsTimeVaryingRate(action.name().toLowerCase(), registry));
        }

        context = MetricsUtil.getContext("linkIndex");
        metricsRecord = MetricsUtil.createRecord(context, recordName);
        context.registerUpdater(this);
View Full Code Here

    private final String recordName;

    public LinkIndexUpdaterMetrics(String recordName) {
        this.recordName = recordName;
        for (Action action : Action.values()) {
            rates.put(action, new MetricsTimeVaryingRate(action.name().toLowerCase(), registry));
        }

        context = MetricsUtil.getContext("linkIndexUpdater");
        metricsRecord = MetricsUtil.createRecord(context, recordName);
        context.registerUpdater(this);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.metrics.util.MetricsTimeVaryingRate

Copyright © 2018 www.massapicom. 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.