ConstSampler implements Sampler { @Override public SamplingStatus sample(String operation, long id) { return SamplingStatus.of(decision, tags); } ConstSampler(boolean decision); @Override SamplingStatus sample(String operation, long id); @Override boolean equals(Object other); @Override void close(); static final String TYPE; }
@Test public void testTags() { ConstSampler sampler = new ConstSampler(true); Map<String, Object> tags = sampler.sample("biryani", 218L).getTags(); assertEquals("const", tags.get("sampler.type")); assertEquals(true, tags.get("sampler.param")); }