Examples of EndPointAnalysis


Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

    @Override
    protected EndPointAnalysis makeEndPoint(Frame frame, int depth) {
        Operation op = frame.getOperation();
        EndPointName endPointName = EndPointName.valueOf(op);
        String example = EndPointAnalysis.getHttpExampleRequest(frame);
        return new EndPointAnalysis(endPointName, op.getLabel(), example, getOperationScore(op, depth), op);
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

    @Override
    protected EndPointAnalysis makeEndPoint(Frame frame, int depth) {
        Operation op = frame.getOperation();
        EndPointName endPointName = EndPointName.valueOf(op);
        String example = EndPointAnalysis.getHttpExampleRequest(frame);
        return new EndPointAnalysis(endPointName, op.getLabel(), example, getOperationScore(op, depth), op);
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

    }

    @Test
    public void locateEndPoint() {
        Trace trace = createLifecycleEndPointTrace();
        EndPointAnalysis analysis = analyzer.locateEndPoint(trace);
        assertEquals("Mismatched label", LifecycleEndPointAnalyzer.ENDPOINT_LABEL, analysis.getResourceLabel());
        assertEquals("Mismatched endpoint name", LifecycleEndPointAnalyzer.ENDPOINT_NAME, analysis.getEndPointName());
        assertEquals("Mismatched example", "start", analysis.getExample());
        assertEquals("Mismatched score", LifecycleEndPointAnalyzer.ANALYSIS_SCORE, analysis.getScore());
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

    }

    @Test
    public void locateEndPoint_noHttp() {
        Trace trace = createNonLifecycleTrace();
        EndPointAnalysis result = analyzer.locateEndPoint(trace);
        assertNull("Unexpected analysis result: " + result, result);
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

            assertEndPointAnalysis(op, 3777347);
        }
    }

    private EndPointAnalysis assertEndPointAnalysis(Operation op, int depth) {
        EndPointAnalysis analysis = analyzer.makeEndPoint(createMockOperationWrapperFrame(op), depth);
        assertNotNull("No analysis", analysis);
        assertSame("Mismatched source operation", op, analysis.getSourceOperation());

        NamedPropertySource props = JmxInvocationEndPointAnalyzer.toPropertySource(op);
        EndPointName name = analysis.getEndPointName();
        assertEquals("Mismatched endpoint",
                PropertiesUtil.format(analyzer.getSettingFormat(JmxInvocationEndPointAnalyzer.ENDPOINT_FORMAT), props),
                name.getName());
        assertEquals("Mismatched label",
                PropertiesUtil.format(analyzer.getSettingFormat(JmxInvocationEndPointAnalyzer.LABEL_FORMAT), props),
                analysis.getResourceLabel());
        assertEquals("Mismatched example",
                PropertiesUtil.format(analyzer.getSettingFormat(JmxInvocationEndPointAnalyzer.EXAMPLE_FORMAT), props),
                analysis.getExample());

        String scoreType = analyzer.getSettingFormat(JmxInvocationEndPointAnalyzer.SCORE_VALUE);
        Number expScore = JmxInvocationEndPointAnalyzer.DEFAULT_SCORE_FORMAT.equals(scoreType)
                ? Integer.valueOf(EndPointAnalysis.depth2score(depth))
                : JmxInvocationEndPointAnalyzer.resolveOperationScore(op, scoreType);
        assertNotNull("Cannot resolve score for mode=" + scoreType, expScore);
        assertEquals("Mismatched score", expScore.intValue(), analysis.getScore());
        return analysis;
    }
View Full Code Here

Examples of com.springsource.insight.intercept.endpoint.EndPointAnalysis

    protected EndPointAnalysis makeEndPoint(Frame grailsFrame, int depth) {
        Operation operation = grailsFrame.getOperation();
        String resourceKey = makeResourceKey(operation.getSourceCodeLocation());
        String resourceLabel = operation.getLabel();
        String exampleRequest = EndPointAnalysis.getHttpExampleRequest(grailsFrame);
        return new EndPointAnalysis(EndPointName.valueOf(resourceKey),
                resourceLabel,
                exampleRequest,
                getOperationScore(operation, depth),
                operation);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.