/** * Add a rate sample for a rate metric * @param name of the rate metric * @param elapsed time */ public void add(String name, long elapsed) { registry.add(name, elapsed); }
/** * Add sample to a stat metric by name. * @param name of the metric * @param value of the snapshot to add */ public synchronized void add(String name, long value) { MutableMetric m = metricsMap.get(name); if (m != null) { if (m instanceof MutableStat) { ((MutableStat) m).add(value); } else { throw new MetricsException("Unsupported add(value) for metric "+ name); } } else { metricsMap.put(name, newRate(name)); // default is a rate metric add(name, value); } }
MutableMetric newForMethod(Object source, Method method, Metric annotation, MetricsRegistry registry) { if (LOG.isDebugEnabled()) { LOG.debug("method "+ method +" with annotation "+ annotation); } MetricsInfo info = getInfo(annotation, method); MutableMetric metric = newForMethod(source, method, annotation); metric = metric != null ? metric : new MethodMetric(source, method, info, annotation.type()); registry.add(info.name(), metric); return metric; }
@Override public void add(String name, long time) { registry.add(name, time); }
MutableMetric metric = newForField(field, annotation); if (metric != null) { registry.add(info.name(), metric); return metric;
protected void snapshot() { // Only add these metrics if the replication table is online and there are peers if (TableState.ONLINE == Tables.getTableState(master.getContext(), ReplicationTable.ID) && !replicationUtil.getPeers().isEmpty()) { registry.add(PENDING_FILES, getNumFilesPendingReplication()); addReplicationQueueTimeMetrics(); } else { registry.add(PENDING_FILES, 0); } registry.add(NUM_PEERS, getNumConfiguredPeers()); registry.add(MAX_REPLICATION_THREADS, getMaxReplicationThreads()); }
/** * Add a rate sample for a rate metric * @param name of the rate metric * @param elapsed time */ public void add(String name, long elapsed) { registry.add(name, elapsed); }
/** * Add a rate sample for a rate metric * @param name of the rate metric * @param elapsed time */ public void add(String name, long elapsed) { registry.add(name, elapsed); }
/** * Add a rate sample for a rate metric * @param name of the rate metric * @param elapsed time */ public void add(String name, long elapsed) { registry.add(name, elapsed); }
/** * Add a rate sample for a rate metric * @param name of the rate metric * @param elapsed time */ public void add(String name, long elapsed) { registry.add(name, elapsed); }
@Override public void add(String name, long time) { registry.add(name, time); }
@Override public void run() { r.add("c1", 42); } });
@Override public void run() { r.add("g1", 42); } });
@Override public void run() { r.add("c1", 42); } });
@Override public void run() { r.add("g1", 42); } });
protected void snapshot() { // Only add these metrics if the replication table is online and there are peers if (TableState.ONLINE == Tables.getTableState(master.getInstance(), ReplicationTable.ID) && !replicationUtil.getPeers().isEmpty()) { registry.add(PENDING_FILES, getNumFilesPendingReplication()); addReplicationQueueTimeMetrics(); } else { registry.add(PENDING_FILES, 0); } registry.add(NUM_PEERS, getNumConfiguredPeers()); registry.add(MAX_REPLICATION_THREADS, getMaxReplicationThreads()); }
MutableMetric newForMethod(Object source, Method method, Metric annotation, MetricsRegistry registry) { if (LOG.isDebugEnabled()) { LOG.debug("method "+ method +" with annotation "+ annotation); } MetricsInfo info = getInfo(annotation, method); MutableMetric metric = newForMethod(source, method, annotation); metric = metric != null ? metric : new MethodMetric(source, method, info, annotation.type()); registry.add(info.name(), metric); return metric; }
MutableMetric newForMethod(Object source, Method method, Metric annotation, MetricsRegistry registry) { if (LOG.isDebugEnabled()) { LOG.debug("method "+ method +" with annotation "+ annotation); } MetricsInfo info = getInfo(annotation, method); MutableMetric metric = newForMethod(source, method, annotation); metric = metric != null ? metric : new MethodMetric(source, method, info, annotation.type()); registry.add(info.name(), metric); return metric; }
MutableMetric newForMethod(Object source, Method method, Metric annotation, MetricsRegistry registry) { if (LOG.isDebugEnabled()) { LOG.debug("method "+ method +" with annotation "+ annotation); } MetricsInfo info = getInfo(annotation, method); MutableMetric metric = newForMethod(source, method, annotation); metric = metric != null ? metric : new MethodMetric(source, method, info, annotation.type()); registry.add(info.name(), metric); return metric; }
MutableMetric newForMethod(Object source, Method method, Metric annotation, MetricsRegistry registry) { if (LOG.isDebugEnabled()) { LOG.debug("method "+ method +" with annotation "+ annotation); } MetricsInfo info = getInfo(annotation, method); MutableMetric metric = newForMethod(source, method, annotation); metric = metric != null ? metric : new MethodMetric(source, method, info, annotation.type()); registry.add(info.name(), metric); return metric; }