Java Code Examples for com.codahale.metrics.MetricFilter#matches()

The following examples show how to use com.codahale.metrics.MetricFilter#matches() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SolrMetricManager.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
@Override
public boolean matches(String s, Metric metric) {
  for (MetricFilter filter : filters) {
    if (filter.matches(s, metric)) {
      return true;
    }
  }
  return false;
}
 
Example 2
Source File: SolrMetricManager.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
@Override
public boolean matches(String s, Metric metric) {
  for (MetricFilter filter : filters) {
    if (!filter.matches(s, metric)) {
      return false;
    }
  }
  return true;
}
 
Example 3
Source File: MetricsFilterList.java    From tajo with Apache License 2.0 5 votes vote down vote up
@Override
public boolean matches(String name, Metric metric) {
  for (MetricFilter eachFilter: filters) {
    if (!eachFilter.matches(name, metric)) {
      return false;
    }
  }
  return true;
}
 
Example 4
Source File: MetricsFilterList.java    From incubator-tajo with Apache License 2.0 5 votes vote down vote up
@Override
public boolean matches(String name, Metric metric) {
  for (MetricFilter eachFilter: filters) {
    if (!eachFilter.matches(name, metric)) {
      return false;
    }
  }
  return true;
}
 
Example 5
Source File: MetricFilters.java    From incubator-gobblin with Apache License 2.0 5 votes vote down vote up
public static MetricFilter and(final MetricFilter metricFilter1, final MetricFilter metricFilter2) {
  return new MetricFilter() {
    @Override public boolean matches(String name, Metric metric) {
      return metricFilter1.matches(name, metric) && metricFilter2.matches(name, metric);
    }
  };
}
 
Example 6
Source File: InnerMetricContext.java    From incubator-gobblin with Apache License 2.0 5 votes vote down vote up
@Override
public void removeMatching(MetricFilter filter) {
  for (Map.Entry<String, InnerMetric> entry : this.contextAwareMetrics.entrySet()) {
    if (filter.matches(entry.getKey(), entry.getValue().getContextAwareMetric())) {
      remove(entry.getKey());
    }
  }
}
 
Example 7
Source File: WithMetricsSupport.java    From beam with Apache License 2.0 4 votes vote down vote up
private Predicate<Map.Entry<String, Gauge>> matches(final MetricFilter filter) {
  return entry -> filter.matches(entry.getKey(), entry.getValue());
}
 
Example 8
Source File: WithMetricsSupport.java    From beam with Apache License 2.0 4 votes vote down vote up
private Predicate<Map.Entry<String, Gauge>> matches(final MetricFilter filter) {
  return entry -> filter.matches(entry.getKey(), entry.getValue());
}