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

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

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

origin: alibaba/jstorm

public CountMetric scope(String key) {
  CountMetric val = _value.get(key);
  if (val == null) {
    _value.put(key, val = new CountMetric());
  }
  return val;
}
origin: alibaba/jstorm

  public Object getValueAndReset() {
    Map ret = new HashMap();
    for (Map.Entry<String, CountMetric> e : _value.entrySet()) {
      ret.put(e.getKey(), e.getValue().getValueAndReset());
    }
    return ret;
  }
}
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: apache/eagle

@Override
public void incrBy(String scopeName, int length) {
  countMetric.scope(scopeName).incrBy(length);
}
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: hmsonline/storm-cassandra-cql

@SuppressWarnings("unchecked")
@Override
public List<T> multiGet(List<List<Object>> keys) {
  try {
    List<T> values = new ArrayList<T>();
    for (List<Object> rowKey : keys) {
      Statement statement = mapper.retrieve(rowKey);
      ResultSet results = session.execute(statement);
      // TODO: Better way to check for empty results besides accessing entire results list
      Iterator<Row> rowIter = results.iterator();
      Row row;
      if (results != null && rowIter.hasNext() && (row = rowIter.next()) != null) {
        if (rowIter.hasNext()) {
          LOG.error("Found non-unique value for key [{}]", rowKey);
        } else {
          values.add((T) mapper.getValue(row));
        }
      } else {
        values.add(null);
      }
    }
    _mreads.incrBy(values.size());
    LOG.debug("Retrieving the following keys: {} with values: {}", keys, values);
    return values;
  } catch (Exception e) {
    checkCassandraException(e);
    throw new IllegalStateException("Impossible to reach this code");
  }
}
origin: com.n3twork.storm/storm-core

public CountMetric scope(String key) {
  CountMetric val = _value.get(key);
  if(val == null) {
    _value.put(key, val = new CountMetric());
  }
  return val;
}
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: com.n3twork.storm/storm-core

  public Object getValueAndReset() {
    Map ret = new HashMap();
    for(Map.Entry<String, CountMetric> e : _value.entrySet()) {
      ret.put(e.getKey(), e.getValue().getValueAndReset());
    }
    return ret;
  }
}
origin: hmsonline/storm-cassandra-cql

  _mwrites.incrBy(statements.size());
} catch (Exception e) {
  checkCassandraException(e);
origin: com.twitter.heron/heron-storm

public CountMetric scope(String key) {
 CountMetric val = value.get(key);
 if (val == null) {
  value.put(key, val = new CountMetric());
 }
 return val;
}
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: com.alibaba.jstorm/jstorm-core

  public Object getValueAndReset() {
    Map ret = new HashMap();
    for (Map.Entry<String, CountMetric> e : _value.entrySet()) {
      ret.put(e.getKey(), e.getValue().getValueAndReset());
    }
    return ret;
  }
}
origin: com.alibaba.jstorm/jstorm-core

public CountMetric scope(String key) {
  CountMetric val = _value.get(key);
  if (val == null) {
    _value.put(key, val = new CountMetric());
  }
  return val;
}
origin: Symantec/hendrix

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

 public Object getValueAndReset() {
  Map<String, Object> ret = new HashMap<>();
  for (Map.Entry<String, CountMetric> e : value.entrySet()) {
   ret.put(e.getKey(), e.getValue().getValueAndReset());
  }
  return ret;
 }
}
origin: hmsonline/storm-cassandra-cql

  @SuppressWarnings("rawtypes")
  public void registerMetrics(Map conf, IMetricsContext context, String mapStateMetricName) {
    int bucketSize = (Integer) (conf.get(Config.TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS));
    String metricBaseName = "cassandra/" + mapStateMetricName;
    _mreads = context.registerMetric(metricBaseName + "/readCount", new CountMetric(), bucketSize);
    _mwrites = context.registerMetric(metricBaseName + "/writeCount", new CountMetric(), bucketSize);
    _mexceptions = context.registerMetric(metricBaseName + "/exceptionCount", new CountMetric(), bucketSize);
  }
}
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: wurstmeister/storm-kafka-0.8-plus

public Map getMetricsDataMap() {
  Map ret = new HashMap();
  ret.put(_partition + "/fetchAPILatencyMax", _fetchAPILatencyMax.getValueAndReset());
  ret.put(_partition + "/fetchAPILatencyMean", _fetchAPILatencyMean.getValueAndReset());
  ret.put(_partition + "/fetchAPICallCount", _fetchAPICallCount.getValueAndReset());
  ret.put(_partition + "/fetchAPIMessageCount", _fetchAPIMessageCount.getValueAndReset());
  return ret;
}
backtype.storm.metric.apiCountMetric

Most used methods

  • <init>
  • incr
  • getValueAndReset
  • incrBy

Popular in Java

  • Finding current android device location
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • From CI to AI: The AI layer in your organization
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