public Object getValueAndReset() { Object ret = _value; _value = _combiner.identity(); return ret; } }
public Object getValueAndReset() { Object ret = _reducer.extractResult(_accumulator); _accumulator = _reducer.init(); return ret; } }
@Override public Object getValueAndReset() { return _obj.getState(); } }
public EventHubReceiverImpl(EventHubSpoutConfig config, String partitionId) { this.connectionString = config.getConnectionString(); this.entityName = config.getEntityPath(); this.partitionId = partitionId; this.consumerGroupName = config.getConsumerGroupName(); receiveApiLatencyMean = new ReducedMetric(new MeanReducer()); receiveApiCallCount = new CountMetric(); receiveMessageCount = new CountMetric(); }
public void skippedBackPressureMs(long ms) { this.skippedBackPressureMs.incrBy(ms); } }
@Override public Map<String, Object> getMetricsData() { Map<String, Object> ret = new HashMap<>(); ret.put(partitionId + "/receiveApiLatencyMean", receiveApiLatencyMean.getValueAndReset()); ret.put(partitionId + "/receiveApiCallCount", receiveApiCallCount.getValueAndReset()); ret.put(partitionId + "/receiveMessageCount", receiveMessageCount.getValueAndReset()); return ret; } }
public ReducedMetric scope(String key) { ReducedMetric val = _value.get(key); if (val == null) { _value.put(key, val = new ReducedMetric(_reducer)); } return val; }
public void incrReportedErrorCount() { this.reportedErrorCount.incr(); }
public ReducedMetric(IReducer reducer) { _reducer = reducer; _accumulator = _reducer.init(); }
public void update(Object value) { _accumulator = _reducer.reduce(_accumulator, value); }
public void update(Object value) { _value = _combiner.combine(_value, value); }
public void cleanup() { if (metricsConsumer != null) { metricsConsumer.cleanup(); } } }
public MeanReducerState init() { return new MeanReducerState(); }
@Override public void cleanup() { _running = false; _metricsConsumer.cleanup(); _taskExecuteThread.interrupt(); }
public void handleDataPoints(final IClusterMetricsConsumer.ClusterInfo clusterInfo, final Collection<DataPoint> dataPoints) { if (metricsConsumer == null) { LOG.error(ERROR_MESSAGE_PREPARATION_CLUSTER_METRICS_CONSUMER_FAILED); return; } try { metricsConsumer.handleDataPoints(clusterInfo, dataPoints); } catch (Throwable e) { LOG.error("Error while handling cluster data points, consumer class: " + consumerClassName, e); } }
public static void registerIconnectionServerMetric(Object server, Map<String, Object> topoConf, TopologyContext context) { if (server instanceof IStatefulObject) { registerMetric("__recv-iconnection", new StateMetric((IStatefulObject) server), topoConf, context); } }
public void incrReportedErrorCountBy(long n) { this.reportedErrorCount.incrBy(n); }
public CombinedMetric(ICombiner combiner) { _combiner = combiner; _value = _combiner.identity(); }
public void skippedMaxSpoutMs(long ms) { this.skippedMaxSpoutMs.incrBy(ms); }
public void skippedInactiveMs(long ms) { this.skippedInactiveMs.incrBy(ms); }