test_class.file: metrics-influxdb/src/test/java/com/izettle/metrics/influxdb/tags/ClassBasedTransformerTest.java
test_class.identifier: ClassBasedTransformerTest
test_case.body: @Test
      public void shouldFindClassNames() {
  
          assertThat(new ClassBasedTransformer().getTags("com.izettle.metrics.influxdb.tags.ClassBasedTransformer.count"))
              .containsEntry("package", "com.izettle.metrics.influxdb.tags")
              .containsEntry("className", "ClassBasedTransformer")
              .containsEntry("method", "count");
  
          assertThat(new ClassBasedTransformer().getTags("com.izettle.metrics.influxdb.tags.ClassBasedTransformer"))
              .containsEntry("package", "com.izettle.metrics.influxdb.tags")
              .containsEntry("className", "ClassBasedTransformer")
              .doesNotContainKeys("method");
  
          assertThat(new ClassBasedTransformer().getTags("metric.without.class"))
              .containsEntry("metricName", "metric.without.class")
              .doesNotContainKeys("package")
              .doesNotContainKeys("className")
              .doesNotContainKeys("method");
      }
test_case.class_method_signature: ClassBasedTransformerTest.shouldFindClassNames()
test_case.full_signature: @Test public void shouldFindClassNames()
test_case.identifier: shouldFindClassNames
test_case.invocations: containsEntry containsEntry containsEntry assertThat getTags doesNotContainKeys containsEntry containsEntry assertThat getTags doesNotContainKeys doesNotContainKeys doesNotContainKeys containsEntry assertThat getTags
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldFindClassNames()
focal_class.declarator: PACKAGE = Pattern.compile("(.*)\\.[A-Z].*")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern PACKAGE = Pattern.compile("(.*)\\.[A-Z].*");
focal_class.type: Pattern
focal_class.var_name: PACKAGE
focal_class.declarator: CLASS_NAME = Pattern.compile(".*\\.([A-Z][^\\.]*).*")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern CLASS_NAME = Pattern.compile(".*\\.([A-Z][^\\.]*).*");
focal_class.type: Pattern
focal_class.var_name: CLASS_NAME
focal_class.declarator: METHOD = Pattern.compile(".*\\.[A-Z][^\\.]*\\.(.*)")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern METHOD = Pattern.compile(".*\\.[A-Z][^\\.]*\\.(.*)");
focal_class.type: Pattern
focal_class.var_name: METHOD
focal_class.file: metrics-influxdb/src/main/java/com/izettle/metrics/influxdb/tags/ClassBasedTransformer.java
focal_class.identifier: ClassBasedTransformer
focal_class.interfaces: implements Transformer
focal_class.class_method_signature: ClassBasedTransformer.getTags(String metricsName)
focal_class.full_signature: @Override public Map<String, String> getTags(String metricsName)
focal_class.identifier: getTags
focal_class.modifiers: @Override public
focal_class.parameters: (String metricsName)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> getTags(String metricsName)
focal_method.body: @Override
      public Map<String, String> getTags(String metricsName) {
          Map<String, String> tags = new HashMap<String, String>();
          tags.put("metricName", metricsName);
  
          Matcher packageMatcher = PACKAGE.matcher(metricsName);
          if(packageMatcher.find()) {
              tags.put("package", packageMatcher.group(1));
          }
          Matcher classMatcher = CLASS_NAME.matcher(metricsName);
          if(classMatcher.find()) {
              tags.put("className", classMatcher.group(1));
          }
          Matcher methodMatcher = METHOD.matcher(metricsName);
          if(methodMatcher.find()) {
              tags.put("method", methodMatcher.group(1));
          }
          return tags;
      }
focal_method.class_method_signature: ClassBasedTransformer.getTags(String metricsName)
focal_method.full_signature: @Override public Map<String, String> getTags(String metricsName)
focal_method.identifier: getTags
focal_method.invocations: put matcher find put group matcher find put group matcher find put group
focal_method.modifiers: @Override public
focal_method.parameters: (String metricsName)
focal_method.return: Map<String, String>
focal_method.signature: Map<String, String> getTags(String metricsName)