use of com.insightfullogic.honest_profiler.core.profiles.Profile in project honest-profiler by jvm-profiling-tools.
the class ProfileTreeTest method assertProfileHasSingleTree.
private ProfileNode assertProfileHasSingleTree() {
Profile profile = listener.getProfile();
List<ProfileTree> trees = profile.getTrees();
assertEquals(1, trees.size());
return trees.get(0).getRootNode();
}
use of com.insightfullogic.honest_profiler.core.profiles.Profile in project honest-profiler by jvm-profiling-tools.
the class ProfileViewTest method rendersMultiBranchProfile.
@Test
public void rendersMultiBranchProfile() {
ProfileNode left = new ProfileNode(ProfileFixtures.println, 1, 2);
ProfileNode right = new ProfileNode(ProfileFixtures.append, 1, 2);
ProfileNode root = new ProfileNode(ProfileFixtures.printf, 1, 1, asList(left, right));
Profile profile = new Profile(2, asList(new FlatProfileEntry(ProfileFixtures.printf, 1, 0, 1)), asList(new FlatProfileEntry(ProfileFixtures.printf, 1, 0, 1)), toTrees(root));
ui.accept(profile);
console.isShowingTraces(2);
console.displaysMethod(ProfileFixtures.printf);
console.displaysMethod(ProfileFixtures.append);
console.displaysMethod(ProfileFixtures.println);
console.outputContains("50.0");
console.outputContains("100.0");
}
use of com.insightfullogic.honest_profiler.core.profiles.Profile in project honest-profiler by jvm-profiling-tools.
the class ProfileViewTest method rendersSingleMethod.
@Test
public void rendersSingleMethod() {
ProfileNode root = new ProfileNode(ProfileFixtures.printf, 1, 1);
Profile profile = new Profile(2, asList(new FlatProfileEntry(ProfileFixtures.printf, 1, 0, 1)), asList(new FlatProfileEntry(ProfileFixtures.printf, 1, 0, 1)), toTrees(root));
ui.accept(profile);
console.isShowingTraces(2);
console.displaysMethod(ProfileFixtures.printf);
console.outputContains("100.0");
}
use of com.insightfullogic.honest_profiler.core.profiles.Profile in project honest-profiler by jvm-profiling-tools.
the class ProfileUpdateModerator method run.
@Override
public void run() {
try {
while (true) {
final Profile profile = incomingProfile.get();
if (profile != null) {
listener.accept(profile);
incomingProfile.compareAndSet(profile, null);
}
Thread.sleep(UI_UPDATE_WINDOW_IN_MS);
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
}
Aggregations