@Test public void successfulAtRoot() { double duration = InvocationTreeUtil.calculateSpanExclusivePercentage(tree); assertThat(duration, is(0.5D)); }
@Test public void nullValue() { double duration = InvocationTreeUtil.calculateSpanExclusivePercentage(null); assertThat(duration, is(Double.NaN)); } }
@Test public void successfulOfAsync() { InvocationTreeElement treeElement = InvocationTreeUtil.lookupTreeElement(InvocationTreeUtil.buildLookupMap(tree), span03); double duration = InvocationTreeUtil.calculateSpanExclusivePercentage(treeElement); assertThat(duration, is(0.2D)); }
@Test public void successfulInTree() { InvocationTreeElement treeElement = InvocationTreeUtil.lookupTreeElement(InvocationTreeUtil.buildLookupMap(tree), span02); double duration = InvocationTreeUtil.calculateSpanExclusivePercentage(treeElement); assertThat(duration, is(closeTo(0.384D, 0.001))); }
exclusive.append(NumberFormatter.formatDouble(InvocationTreeUtil.calculateSpanExclusiveDuration(ite), timeDecimalPlaces)); exclusive.append(" (", StyledString.COUNTER_STYLER); int percentage = Math.round((float) InvocationTreeUtil.calculateSpanExclusivePercentage(ite) * 100); exclusive.append(NumberFormatter.formatInteger(percentage), StyledString.COUNTER_STYLER); exclusive.append("%)", StyledString.COUNTER_STYLER);