public ReducedMetric scope(String key) { ReducedMetric val = _value.get(key); if (val == null) { _value.put(key, val = new ReducedMetric(_reducer)); } return val; }
@Deprecated public ReducedMetric registerMetric(String name, IReducer reducer, int timeBucketSizeInSecs) { return registerMetric(name, new ReducedMetric(reducer), timeBucketSizeInSecs); }
public ReducedMetric registerMetric(String name, IReducer reducer, int timeBucketSizeInSecs) { return _topoContext.registerMetric(name, new ReducedMetric(reducer), timeBucketSizeInSecs); }
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 ReducedMetric scope(String key) { ReducedMetric val = _value.get(key); if(val == null) { _value.put(key, val = new ReducedMetric(_reducer)); } return val; }
public ReducedMetric scope(String key) { ReducedMetric val = value.get(key); if (val == null) { value.put(key, val = new ReducedMetric(reducer)); } return val; }
@Deprecated public ReducedMetric registerMetric(String name, IReducer reducer, int timeBucketSizeInSecs) { return registerMetric(name, new ReducedMetric(reducer), timeBucketSizeInSecs); } /*
public ReducedMetric registerMetric(String name, IReducer reducer, int timeBucketSizeInSecs) { return _topoContext.registerMetric(name, new ReducedMetric(reducer), timeBucketSizeInSecs); } public CombinedMetric registerMetric(String name, ICombiner combiner, int timeBucketSizeInSecs) {
@SuppressWarnings("rawtypes") public ReducedMetric registerMetric(String name, IReducer reducer, int timeBucketSizeInSecs) { return registerMetric(name, new ReducedMetric(reducer), timeBucketSizeInSecs); }
/** * Registers a metric that averages its values with the configured interval for it (if any). * * @param name The name of the metric to register. * @param context The {@link TopologyContext} to register the metric for. * @return The registered {@link ReducedMetric} that is averaging. */ protected ReducedMetric registerAveragingMetric(String name, TopologyContext context) { return registerMetric(new ReducedMetric(new MeanReducer()), name, context); }
/** * Registers a metric that averages its values with the configured interval for it (if any). * * @param name The name of the metric to register. * @param context The {@link TopologyContext} to register the metric for. * @return The registered {@link ReducedMetric} that is averaging. */ protected ReducedMetric registerAveragingMetric(String name, TopologyContext context) { return registerMetric(new ReducedMetric(new MeanReducer()), name, context); }
_fetchAPILatencyMean = new ReducedMetric(new MeanReducer()); _fetchAPICallCount = new CountMetric(); _fetchAPIMessageCount = new CountMetric();
@Override @SuppressWarnings({ "rawtypes", "unchecked" }) public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { super.prepare(stormConf, context, collector); parser = new SiteMapParser(false); sniffWhenNoSMKey = ConfUtils.getBoolean(stormConf, "sitemap.sniffContent", false); filterHoursSinceModified = ConfUtils.getInt(stormConf, "sitemap.filter.hours.since.modified", -1); parseFilters = ParseFilters.fromConf(stormConf); maxOffsetGuess = ConfUtils.getInt(stormConf, "sitemap.offset.guess", 300); averagedMetrics = context.registerMetric( "sitemap_average_processing_time", new ReducedMetric( new MeanReducer()), 30); scheduleSitemapsWithDelay = ConfUtils.getInt(stormConf, "sitemap.schedule.delay", scheduleSitemapsWithDelay); }
private void initializeAndRegisterAllMetrics(TopologyContext context, int timeBucketSize) { this.failureMetric = new CombinedMetric(new MaxMetric()); this.successCountMetric = new CountMetric(); this.sidelineCountMetric = new CountMetric(); this.internalBufferSize = new CombinedMetric(new MaxMetric()); this.pendingMessageSize = new CombinedMetric(new MaxMetric()); this.currentBinLogFileNumber = new CombinedMetric(new MaxMetric()); this.currentBinLogFilePosition = new CombinedMetric(new MaxMetric()); this.txEventProcessTime = new ReducedMetric(new MeanReducer()); this.txEventFailTimeInTopology = new ReducedMetric(new MeanReducer()); context.registerMetric(SpoutConstants.METRIC_FAILURECOUNT, this.failureMetric, timeBucketSize); context.registerMetric(SpoutConstants.METRIC_SUCCESSCOUNT, this.successCountMetric, timeBucketSize); context.registerMetric(SpoutConstants.METRIC_SIDELINECOUNT, this.sidelineCountMetric, timeBucketSize); context.registerMetric(SpoutConstants.METRIC_BUFFER_SIZE, this.internalBufferSize, timeBucketSize); context.registerMetric(SpoutConstants.METRIC_PENDING_MESSAGES, this.pendingMessageSize, timeBucketSize); context.registerMetric(SpoutConstants.METRIC_TXPROCESSTIME, this.txEventProcessTime, timeBucketSize); context.registerMetric(SpoutConstants.METRIC_BINLOG_FILE_NUM, this.currentBinLogFileNumber, timeBucketSize); context.registerMetric(SpoutConstants.METRIC_BIN_LOG_FILE_POS, this.currentBinLogFilePosition, timeBucketSize); context.registerMetric(SpoutConstants.METRIC_FAIL_MSG_IN_TOPOLOGY, this.txEventFailTimeInTopology, timeBucketSize); }