use of com.insightfullogic.honest_profiler.core.profiles.lean.info.MethodInfo in project honest-profiler by jvm-profiling-tools.
the class LeanLogCollector method handle.
/**
* Processes a {@link Method} which maps the method id to method information by putting the information into the
* method map if it isn't there yet.
*/
@Override
public void handle(Method newMethod) {
methodMap.putIfAbsent(newMethod.getMethodId(), new MethodInfo(newMethod));
emitProfileIfNeeded();
}
use of com.insightfullogic.honest_profiler.core.profiles.lean.info.MethodInfo in project honest-profiler by jvm-profiling-tools.
the class LeanProfileGenerator method assertContains.
public void assertContains(Method... methods) {
asList(methods).forEach(method -> {
MethodInfo info = currentProfile.getMethodInfoMap().get(method.getMethodId());
assertEquals("Method Id mismatch", method.getMethodId(), info.getMethodId());
assertEquals("Method Name mismatch", method.getMethodName(), info.getMethodName());
assertEquals("Method Class Name mismatch", method.getClassName(), info.getClassName());
assertEquals("Method File Name mismatch", method.getFileName(), info.getFileName());
});
}
use of com.insightfullogic.honest_profiler.core.profiles.lean.info.MethodInfo in project honest-profiler by jvm-profiling-tools.
the class LeanProfile method getFqmn.
// Key and/or name Construction Methods
/**
* Calculates the FQMN. Introduced for hardening, based on a profile which contained a Method Id for which no
* MethodInfo was available.
* <p>
*
* @return the FQMN for the node
*/
public String getFqmn(LeanNode node) {
long methodId = node.getFrame().getMethodId();
MethodInfo info = getMethodInfoMap().get(methodId);
// Explicit NULL check because we encountered a profile where a particular MethodInfo wasn't present
return info == null ? "<UNIDENTIFIED : Method Id = " + methodId + ">" : info.getFqmn();
}
use of com.insightfullogic.honest_profiler.core.profiles.lean.info.MethodInfo in project honest-profiler by jvm-profiling-tools.
the class AbstractFlameCanvas method renderNodeText.
// Internal Implementation Methods
/**
* Renders the textual information for the {@link Node} or {@link DiffNode}.
*
* @param ctx the {@link GraphicsContext} in which the text is rendered
* @param color the {@link Color} for rendering the text
* @param x the x coordinate where the text should be rendered
* @param y the y coordinate where the text should be rendered
* @param width the width within which the text should fit
* @param height the height within which the text should fit
* @param node the node whose information is to be rendered
*/
private void renderNodeText(final GraphicsContext ctx, Color color, final double x, final double y, double width, double height, U node) {
List<String> titles = new ArrayList<>();
titles.add(node.getKey());
MethodInfo method = methodForNode(node);
if (method != null) {
titles.add(method.getFqmn());
titles.add(method.getCompactName());
titles.add(method.getMethodName());
}
renderText(ctx, color, x, y, width, height, titles.toArray(new String[titles.size()]));
}
Aggregations