use of com.netflix.spectator.api.BasicTag in project incubator-servicecomb-java-chassis by apache.
the class TestDefaultTagFinder method readSucc.
@Test
public void readSucc() {
Tag tag = new BasicTag("key", "value");
List<Tag> tags = Arrays.asList(new BasicTag("t1", "t1v"), tag);
Assert.assertSame(tag, finder.find(tags));
}
use of com.netflix.spectator.api.BasicTag in project incubator-servicecomb-java-chassis by apache.
the class TestDefaultTagFinder method readFail.
@Test
public void readFail() {
List<Tag> tags = Arrays.asList(new BasicTag("t1", "t1v"));
Assert.assertNull(finder.find(tags));
}
use of com.netflix.spectator.api.BasicTag in project java-chassis by ServiceComb.
the class ThreadPoolMetersInitializer method createThreadPoolMeters.
protected void createThreadPoolMeters(String threadPoolName, Executor executor) {
if (!ThreadPoolExecutor.class.isInstance(executor)) {
return;
}
ThreadPoolMonitor.attach(registry, (ThreadPoolExecutor) executor, threadPoolName);
if (executor instanceof ThreadPoolExecutorEx) {
Tag idTag = new BasicTag("id", threadPoolName);
PolledMeter.using(registry).withName(REJECTED_COUNT).withTag(idTag).monitorMonotonicCounter((ThreadPoolExecutorEx) executor, ThreadPoolExecutorEx::getRejectedCount);
}
}
use of com.netflix.spectator.api.BasicTag in project java-chassis by ServiceComb.
the class TestDefaultTagFinder method readSucc.
@Test
public void readSucc() {
Tag tag = new BasicTag("key", "value");
List<Tag> tags = Arrays.asList(new BasicTag("t1", "t1v"), tag);
Assert.assertSame(tag, finder.find(tags));
}
use of com.netflix.spectator.api.BasicTag in project java-chassis by ServiceComb.
the class TestDefaultTagFinder method readFail.
@Test
public void readFail() {
List<Tag> tags = Arrays.asList(new BasicTag("t1", "t1v"));
Assert.assertNull(finder.find(tags));
}
Aggregations