@Test public void testStandardMapping() { MonitorConfig config = MonitorConfig.builder("testName").withTag("foo", "bar").build(); ObjectName name = DEFAULT_MAPPER.createObjectName(TEST_DOMAIN, new BasicCounter(config)); assertEquals(name.getDomain(), TEST_DOMAIN); assertEquals(name.getKeyPropertyListString(), String.format("name=testName,foo=bar,%s=COUNTER", DataSourceType.KEY)); }
@Override public ObjectName createObjectName(String domain, Monitor<?> monitor) { ObjectNameBuilder objNameBuilder = ObjectNameBuilder.forDomain(domain); objNameBuilder.addProperty("name", monitor.getConfig().getName()); objNameBuilder.addProperties(monitor.getConfig().getTags()); return objNameBuilder.build(); }
DefaultObjectNameMapper implements ObjectNameMapper { @Override public ObjectName createObjectName(String domain, Monitor<?> monitor) { ObjectNameBuilder objNameBuilder = ObjectNameBuilder.forDomain(domain); objNameBuilder.addProperty("name", monitor.getConfig().getName()); objNameBuilder.addProperties(monitor.getConfig().getTags()); return objNameBuilder.build(); } }
DefaultObjectNameMapper implements ObjectNameMapper { @Override public ObjectName createObjectName(String domain, Monitor<?> monitor) { ObjectNameBuilder objNameBuilder = ObjectNameBuilder.forDomain(domain); objNameBuilder.addProperty("name", monitor.getConfig().getName()); objNameBuilder.addProperties(monitor.getConfig().getTags()); return objNameBuilder.build(); }  }
DefaultObjectNameMapper implements ObjectNameMapper { @Override public ObjectName createObjectName(String domain, Monitor<?> monitor) { ObjectNameBuilder objNameBuilder = ObjectNameBuilder.forDomain(domain); objNameBuilder.addProperty("name", monitor.getConfig().getName()); objNameBuilder.addProperties(monitor.getConfig().getTags()); return objNameBuilder.build(); }  @Override ObjectName createObjectName(String domain, Monitor<?> monitor); }
DefaultObjectNameMapper implements ObjectNameMapper { @Override public ObjectName createObjectName(String domain, Monitor<?> monitor) { ObjectNameBuilder objNameBuilder = ObjectNameBuilder.forDomain(domain); objNameBuilder.addProperty("name", monitor.getConfig().getName()); objNameBuilder.addProperties(monitor.getConfig().getTags()); return objNameBuilder.build(); }  @Override ObjectName createObjectName(String domain, Monitor<?> monitor);  }