Package com.codahale.metrics

Examples of com.codahale.metrics.MetricFilter.matches()


  public void testCompletelyEmpty() throws Exception {
    String str = "{}";
    Config config = ConfigFactory.parseString(str);
    MetricFilter filter = PatternMetricFilter.parse(new Configs(), config);
    assertSame(filter, MetricFilter.ALL);
    assertTrue(filter.matches("foo", new Counter()));
  }
 
  @Test
  public void testEmpty() throws Exception {
    String str = "{ metricFilter : {} }";
View Full Code Here


  public void testEmpty() throws Exception {
    String str = "{ metricFilter : {} }";
    Config config = ConfigFactory.parseString(str);
    MetricFilter filter = PatternMetricFilter.parse(new Configs(), config);
    assertNotSame(filter, MetricFilter.ALL);
    assertTrue(filter.matches("foo", new Counter()));
    assertTrue(filter.toString().length() > 0);
  }
 
  @Test
  public void testComplex() throws Exception {
View Full Code Here

      "\n }}}";

    Config config = ConfigFactory.parseString(str);
    MetricFilter filter = PatternMetricFilter.parse(new Configs(), config);
    assertNotSame(filter, MetricFilter.ALL);
    assertTrue(filter.matches("foo", new Counter()));
    assertTrue(filter.matches("boo", new Counter()));
    assertFalse(filter.matches("foo.bar", new Counter()));
    assertFalse(filter.matches("boo", new Timer()));
    assertTrue(filter.toString().length() > 0);
  }
View Full Code Here

    Config config = ConfigFactory.parseString(str);
    MetricFilter filter = PatternMetricFilter.parse(new Configs(), config);
    assertNotSame(filter, MetricFilter.ALL);
    assertTrue(filter.matches("foo", new Counter()));
    assertTrue(filter.matches("boo", new Counter()));
    assertFalse(filter.matches("foo.bar", new Counter()));
    assertFalse(filter.matches("boo", new Timer()));
    assertTrue(filter.toString().length() > 0);
  }
 
View Full Code Here

    Config config = ConfigFactory.parseString(str);
    MetricFilter filter = PatternMetricFilter.parse(new Configs(), config);
    assertNotSame(filter, MetricFilter.ALL);
    assertTrue(filter.matches("foo", new Counter()));
    assertTrue(filter.matches("boo", new Counter()));
    assertFalse(filter.matches("foo.bar", new Counter()));
    assertFalse(filter.matches("boo", new Timer()));
    assertTrue(filter.toString().length() > 0);
  }
 
  @Test
View Full Code Here

    MetricFilter filter = PatternMetricFilter.parse(new Configs(), config);
    assertNotSame(filter, MetricFilter.ALL);
    assertTrue(filter.matches("foo", new Counter()));
    assertTrue(filter.matches("boo", new Counter()));
    assertFalse(filter.matches("foo.bar", new Counter()));
    assertFalse(filter.matches("boo", new Timer()));
    assertTrue(filter.toString().length() > 0);
  }
 
  @Test
  public void testNotIncluded() throws Exception {
View Full Code Here

      "\n }}";

    Config config = ConfigFactory.parseString(str);
    MetricFilter filter = PatternMetricFilter.parse(new Configs(), config);
    assertNotSame(filter, MetricFilter.ALL);
    assertTrue(filter.matches("foo", new Counter()));
    assertFalse(filter.matches("boo", new Counter()));
    assertTrue(filter.toString().length() > 0);
  }
 
  @Test
View Full Code Here

    Config config = ConfigFactory.parseString(str);
    MetricFilter filter = PatternMetricFilter.parse(new Configs(), config);
    assertNotSame(filter, MetricFilter.ALL);
    assertTrue(filter.matches("foo", new Counter()));
    assertFalse(filter.matches("boo", new Counter()));
    assertTrue(filter.toString().length() > 0);
  }
 
  @Test
  public void testWildcardMeansMatchAll() throws Exception {
View Full Code Here

      "\n }}";

    Config config = ConfigFactory.parseString(str);
    MetricFilter filter = PatternMetricFilter.parse(new Configs(), config);
    assertNotSame(filter, MetricFilter.ALL);
    assertTrue(filter.matches("foo", new Counter()));
    assertTrue(filter.matches("boo", new Counter()));
    assertTrue(filter.toString().length() > 0);
  }
 
  @Test
View Full Code Here

    Config config = ConfigFactory.parseString(str);
    MetricFilter filter = PatternMetricFilter.parse(new Configs(), config);
    assertNotSame(filter, MetricFilter.ALL);
    assertTrue(filter.matches("foo", new Counter()));
    assertTrue(filter.matches("boo", new Counter()));
    assertTrue(filter.toString().length() > 0);
  }
 
  @Test
  public void testUnrecognizedPatternType() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.