@Override public Frame getScoringFrame(Trace trace) { Frame root=trace.getRootFrame(); if (validateScoringFrame(root) == null) { return null; } else { return root; } }
public List<TraceError> locateErrors(Trace trace) { Frame root = trace.getRootFrame(); if (root == null) { return EMPTY_LIST; } Operation rootOp = root.getOperation(); String exception = rootOp.get(EXCEPTION, String.class); if (exception != null) { int chars = Math.min(exception.length(), MAX_ERROR_LENGTH); return singletonList(new TraceError(exception.substring(0, chars))); } return EMPTY_LIST; } }
public List<TraceError> locateErrors(Trace trace) { Frame root = trace.getRootFrame(); if (root == null) { return Collections.emptyList(); } Operation rootOp = root.getOperation(); String exception = rootOp.get(OperationFields.EXCEPTION, String.class); if (!StringUtil.isEmpty(exception)) { int chars = Math.min(exception.length(), MAX_ERROR_LENGTH); return Collections.singletonList(new TraceError(exception.substring(0, chars))); } return Collections.emptyList(); } }
public boolean filters(TraceInterface traceAccess) { Trace trace = traceAccess.asTrace(); Frame rootFrame = trace.getRootFrame(); Operation op = rootFrame.getOperation(); OperationMap details = op.get("request", OperationMap.class); if (details == null) { return false; } String path = details.get(OperationFields.URI, String.class); if (StringUtil.isEmpty(path)) { return false; } if (pathMatchesPatterns(path)) { if (log.isDebugEnabled()) { log.debug("Frame " + op.getLabel() + " with path " + path + " filtered"); } return true; } return false; }
public TraceSource locateTraceSource(TraceInterface traceAccess) { if (!active || traceAccess == null || ListUtil.size(analyzers) <= 0) { return null; } TraceSource source = null; if (traceAccess instanceof TraceSourceCarrier) { TraceSourceCarrier carrier = (TraceSourceCarrier) traceAccess; if (!carrier.isTraceSourceAnalysisRequired()) { source = carrier.getTraceSource(); } } if (source == null) { Frame root = traceAccess.asTrace().getRootFrame(); for (TraceSourceAnalyzer analyzer : analyzers) { source = analyzer.getTraceSource(root); if (source != null) { break; } } } return TraceSource.isNullSource(source) ? null : source; }
public EndPointAnalysis locateEndPoint(Trace trace) { Frame root = trace.getRootFrame(); if (root == null) { return null; } Operation rootOp = root.getOperation(); if (!rootOp.getType().equals(TYPE)) { return null; } EndPointName name = EndPointName.valueOf(rootOp.getSourceCodeLocation().getClassName() + "#" + rootOp.get("methodSignature")); String label = rootOp.getLabel(); String exampleRequest = ""; OperationList args = rootOp.get("arguments", OperationList.class); if (args.size() == 1) { exampleRequest = args.get(0, String.class); } int score = 0; return new EndPointAnalysis(root.getRange(), name, label, exampleRequest, score); } }
public List<ColorCommand> generateCommands(TraceAnalysis analysis) { Trace trace=analysis.getTrace(); Frame root=trace.getRootFrame(); Operation op=root.getOperation(); List<Color> inColors = ColorManager.valueOf(op);