Tabnine Logo
CountMetric.incr
Code IndexAdd Tabnine to your IDE (free)

How to use
incr
method
in
backtype.storm.metric.api.CountMetric

Best Java code snippets using backtype.storm.metric.api.CountMetric.incr (Showing top 17 results out of 315)

origin: apache/eagle

@Override
public void incr(String scopeName) {
  countMetric.scope(scopeName).incr();
}
origin: wurstmeister/storm-kafka-0.8-plus

private void fill() {
  long start = System.nanoTime();
  ByteBufferMessageSet msgs = KafkaUtils.fetchMessages(_spoutConfig, _consumer, _partition, _emittedToOffset);
  long end = System.nanoTime();
  long millis = (end - start) / 1000000;
  _fetchAPILatencyMax.update(millis);
  _fetchAPILatencyMean.update(millis);
  _fetchAPICallCount.incr();
  int numMessages = countMessages(msgs);
  _fetchAPIMessageCount.incrBy(numMessages);
  if (numMessages > 0) {
    LOG.info("Fetched " + numMessages + " messages from: " + _partition);
  }
  for (MessageAndOffset msg : msgs) {
    _pending.add(_emittedToOffset);
    _waitingToEmit.add(new MessageAndRealOffset(msg.message(), _emittedToOffset));
    _emittedToOffset = msg.nextOffset();
  }
  if (numMessages > 0) {
    LOG.info("Added " + numMessages + " messages from: " + _partition + " to internal buffers");
  }
}
origin: Symantec/hendrix

@Override
public void reportRuleHit(String ruleGroup, short ruleId) {
  if (multiTenancyActive) {
    ruleHitCount.scope(Utils.concat(ruleGroup, TENANTID_SEPARATOR, String.valueOf(ruleId))).incr();
  } else {
    ruleHitCount.scope(String.valueOf(ruleId)).incr();
  }
}
origin: com.srotya.tau/tau-dengine

@Override
public void reportRuleHit(String ruleGroup, short ruleId) {
  ruleHitCount.scope(Utils.concat(ruleGroup, TENANTID_SEPARATOR, String.valueOf(ruleId))).incr();
}
origin: Symantec/hendrix

@Override
public void handleRuleNoMatch(OutputCollector eventCollector, Tuple eventContainer, Event inputEvent, Rule rule) {
  ruleNoHitCount.scope(String.valueOf(rule.getRuleId())).incr();
}
origin: hmsonline/storm-cassandra-cql

protected void checkCassandraException(Exception e) {
  _mexceptions.incr();
  if (e instanceof AlreadyExistsException ||
      e instanceof AuthenticationException ||
      e instanceof DriverException ||
      e instanceof DriverInternalError ||
      e instanceof InvalidConfigurationInQueryException ||
      e instanceof InvalidQueryException ||
      e instanceof InvalidTypeException ||
      e instanceof QueryExecutionException ||
      e instanceof QueryValidationException ||
      e instanceof ReadTimeoutException ||
      e instanceof SyntaxError ||
      e instanceof TraceRetrievalException ||
      e instanceof TruncateException ||
      e instanceof UnauthorizedException ||
      e instanceof UnavailableException ||
      e instanceof ReadTimeoutException ||
      e instanceof WriteTimeoutException ||
      e instanceof ReadFailureException ||
      e instanceof WriteFailureException ||
      e instanceof FunctionExecutionException) {
    throw new ReportedFailedException(e);
  } else {
    throw new RuntimeException(e);
  }
}
origin: com.srotya.tau/tau-dengine

@Override
public void handleRuleNoMatch(OutputCollector eventCollector, Tuple eventContainer, Event inputEvent, Rule rule) {
  ruleNoHitCount.scope(String.valueOf(rule.getRuleId())).incr();
}
origin: Symantec/hendrix

@Override
public void execute(Tuple input) {
  String jsonStr = input.getString(0);
  try {
    JsonObject json = gson.fromJson(jsonStr, JsonObject.class);
    try {
      interceptor.validate(json);
      collector.emit(input, new Values(gson.toJson(json)));
      if (sucessMetric != null) {
        sucessMetric.incr();
      }
    } catch (ValidationException e) {
      if (failMetric != null) {
        failMetric.incr();
      }
      StormContextUtil.emitErrorTuple(collector, input, InterceptionBolt.class, jsonStr, e.getMessage(), e);
    }
  } catch (Exception e) {
    if (failMetric != null) {
      failMetric.incr();
    }
    StormContextUtil.emitErrorTuple(collector, input, InterceptionBolt.class, jsonStr, e.getMessage(), e);
  }
  collector.ack(input);
}
origin: com.srotya.tau/tau-dengine

@Override
public void execute(Tuple input) {
  String jsonStr = input.getString(0);
  try {
    JsonObject json = gson.fromJson(jsonStr, JsonObject.class);
    try {
      interceptor.validate(json);
      collector.emit(input, new Values(gson.toJson(json)));
      if (sucessMetric != null) {
        sucessMetric.incr();
      }
    } catch (ValidationException e) {
      if (failMetric != null) {
        failMetric.incr();
      }
      StormContextUtil.emitErrorTuple(collector, input, InterceptionBolt.class, jsonStr, e.getMessage(), e);
    }
  } catch (Exception e) {
    if (failMetric != null) {
      failMetric.incr();
    }
    StormContextUtil.emitErrorTuple(collector, input, InterceptionBolt.class, jsonStr, e.getMessage(), e);
  }
  collector.ack(input);
}
origin: com.srotya.tau/tau-dengine

sucessMetric.incr();
failMetric.incr();
origin: Symantec/hendrix

@SuppressWarnings("unchecked")
@Override
public void execute(Tuple input) {
  String eventLine = input.getString(0);
  try {
    Event event = factory.buildEvent();
    Map<String, Object> map = (Map<String, Object>) gson.fromJson(eventLine, type);
    if (map != null) {
      event.getHeaders().putAll(map);
      event.getHeaders().put(Constants.FIELD_TIMESTAMP,
          ((Double) event.getHeaders().get(timestampKey)).longValue());
      event.getHeaders().put(Constants.FIELD_RULE_GROUP, event.getHeaders().get(tenantIdKey));
      collector.emit(input, new Values(event));
    } else {
      throw INVALID_JSON;
    }
    if (sucessMetric != null) {
      sucessMetric.incr();
    }
  } catch (Exception e) {
    // emit error
    if (failMetric != null) {
      failMetric.incr();
    }
    StormContextUtil.emitErrorTuple(collector, input, JSONTranslatorBolt.class, "JSON to Map issue", eventLine,
        e);
  }
  collector.ack(input);
}
origin: Symantec/hendrix

  long timestamp) {
Alert alert = new Alert();
templateHit.scope(String.valueOf(templateId)).incr();
VelocityAlertTemplate template = templateMap.get(templateId);
if (template != null) {
origin: com.srotya.tau/tau-dengine

  short templateId, long timestamp) {
Alert alert = new Alert();
templateHit.scope(String.valueOf(templateId)).incr();
VelocityAlertTemplate template = templateMap.get(templateId);
if (template != null) {
origin: com.srotya.tau/tau-dengine

protected void aggregate(Tuple tuple) {
  try {
    aggregationHit.scope(Utils.separateRuleActionId(tuple.getStringByField(Constants.FIELD_RULE_ACTION_ID))
        .getKey().toString()).incr();
    engine.aggregate(tuple.getLongByField(Constants.FIELD_TIMESTAMP),
        tuple.getIntegerByField(Constants.FIELD_AGGREGATION_WINDOW),
        tuple.getStringByField(Constants.FIELD_RULE_ACTION_ID),
        tuple.getStringByField(Constants.FIELD_AGGREGATION_KEY),
        tuple.getStringByField(Constants.FIELD_AGGREGATION_VALUE));
    buffer.add(tuple);
    if (buffer.size() >= bufferSize) {
      flushAckAndClearBuffer();
    }
  } catch (AggregationRejectException e) {
    StormContextUtil.emitErrorTuple(collector, tuple, MarkovianAggregationBolt.class, "",
        "Aggregation rejected", e);
    collector.ack(tuple);
  } catch (IOException e) {
    failAndClearBuffer();
    StormContextUtil.emitErrorTuple(collector, tuple, MarkovianAggregationBolt.class, "",
        "Aggregation flush failed", e);
  }
}
origin: Symantec/hendrix

protected void aggregate(Tuple tuple) {
  try {
    aggregationHit.scope(Utils.separateRuleActionId(tuple.getStringByField(Constants.FIELD_RULE_ACTION_ID))
        .getKey().toString()).incr();
    engine.aggregate(tuple.getLongByField(Constants.FIELD_TIMESTAMP),
        tuple.getIntegerByField(Constants.FIELD_AGGREGATION_WINDOW),
        tuple.getStringByField(Constants.FIELD_RULE_ACTION_ID),
        tuple.getStringByField(Constants.FIELD_AGGREGATION_KEY),
        tuple.getStringByField(Constants.FIELD_AGGREGATION_VALUE));
    buffer.add(tuple);
    if (buffer.size() >= bufferSize) {
      flushAckAndClearBuffer();
    }
  } catch (AggregationRejectException e) {
    StormContextUtil.emitErrorTuple(collector, tuple, MarkovianAggregationBolt.class, "",
        "Aggregation rejected", e);
    collector.ack(tuple);
  } catch (IOException e) {
    failAndClearBuffer();
    StormContextUtil.emitErrorTuple(collector, tuple, MarkovianAggregationBolt.class, "",
        "Aggregation flush failed", e);
  }
}
origin: com.srotya.tau/tau-dengine

protected void trackState(Tuple tuple) {
  try {
    stateHit.scope(Utils.separateRuleActionId(tuple.getStringByField(Constants.FIELD_RULE_ACTION_ID))
        .getKey().toString()).incr();
    if (tuple.getBooleanByField(Constants.FIELD_STATE_TRACK)) {
      logger.fine("State tracking true:" + tuple);
origin: Symantec/hendrix

protected void trackState(Tuple tuple) {
  try {
    stateHit.scope(Utils.separateRuleActionId(tuple.getStringByField(Constants.FIELD_RULE_ACTION_ID))
        .getKey().toString()).incr();
    if (tuple.getBooleanByField(Constants.FIELD_STATE_TRACK)) {
      logger.fine("State tracking true:" + tuple);
backtype.storm.metric.apiCountMetricincr

Popular methods of CountMetric

  • <init>
  • getValueAndReset
  • incrBy

Popular in Java

  • Reactive rest calls using spring rest template
  • getContentResolver (Context)
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • JList (javax.swing)
  • JTable (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now