public JmxCollector register() {
        return register(PrometheusRegistry.defaultRegistry);
    }
@Test
    public void testServletRequestPattern() throws Exception {
        JmxCollector jc =
                new JmxCollector(
                                "\n---\nrules:\n- pattern: 'Catalina<j2eeType=Servlet, WebModule=//([-a-zA-Z0-9+&@#/%?=~_|!:.,;]*[-a-zA-Z0-9+&@#/%=~_|]),\n    name=([-a-zA-Z0-9+/$%~_-|!.]*), J2EEApplication=none, \nJ2EEServer=none><>RequestCount:'\n  name: tomcat_request_servlet_count\n  labels:\n    module: `$1`\n    servlet: `$2`\n  help: Tomcat servlet request count\n  type: COUNTER\n  attrNameSnakeCase: false"
                                        .replace('`', '"'))
                        .register(prometheusRegistry);
        assertEquals(
                1.0,
                getSampleValue(
                        "tomcat_request_servlet_count",
                        new String[] {"module", "servlet"},
                        new String[] {"localhost/host-manager", "HTMLHostManager"}),
                .001);
    }