@Test public void testConsumerSetLevel() throws Exception { ProfileCollector collector = getCollector(serverNode); ProfileConsumer cons1 = collector.getConsumer("c1"); assertEquals(profileCollector.getDefaultProfileLevel(), cons1.getProfileLevel()); cons1.setProfileLevel(ProfileLevel.MIN); assertEquals(ProfileLevel.MIN, cons1.getProfileLevel()); cons1.setProfileLevel(ProfileLevel.MEDIUM); assertEquals(ProfileLevel.MEDIUM, cons1.getProfileLevel()); cons1.setProfileLevel(ProfileLevel.MAX); assertEquals(ProfileLevel.MAX, cons1.getProfileLevel()); }
@Test public void testConsumerSetCollectorLevel() throws Exception { ProfileCollector collector = getCollector(serverNode); ProfileConsumer cons1 = collector.getConsumer("c1"); ProfileLevel cons1Level = cons1.getProfileLevel(); assertEquals(profileCollector.getDefaultProfileLevel(), cons1Level); // Change default level from what the kernel set, make sure it // affects later consumers. profileCollector.setDefaultProfileLevel(ProfileLevel.MIN); ProfileConsumer cons2 = collector.getConsumer("c2"); assertEquals(profileCollector.getDefaultProfileLevel(), cons2.getProfileLevel()); // and make sure other consumers aren't affected assertEquals(cons1Level, cons1.getProfileLevel()); }