Package com.springsource.insight.intercept.trace

Examples of com.springsource.insight.intercept.trace.Trace


        });
    }

    @Test
    public void testJdbcTrace() throws Exception {
        Trace trace = loadTrace("JdbcTraceTest");
        Map<OperationType, List<MetricsBag>> result = analyzeTrace("testJdbcTrace", trace, metricsGenerators.values());
        assertEquals("Mismatched results size", 1, MapUtil.size(result));

        List<MetricsBag> jdbcOperationMetrics = result.get(JdbcOperationExternalResourceAnalyzer.TYPE);
        assertEquals("Mismatched operation metrics size: " + jdbcOperationMetrics, 2, ListUtil.size(jdbcOperationMetrics));
View Full Code Here


            //test external resources
            SimpleFrameBuilder builder = new SimpleFrameBuilder();
            builder.enter(op);
            Frame frame = builder.exit();
            Trace trace = Trace.newInstance(ApplicationName.valueOf("app"), TraceId.valueOf("0"), frame);

            List<ExternalResourceDescriptor> externalResourceDescriptors = (List<ExternalResourceDescriptor>) analyzer.locateExternalResourceName(trace);
            assertNotNull("No descriptors extracted", externalResourceDescriptors);
            ExternalResourceDescriptor descriptor = externalResourceDescriptors.get(0);
            assertSame("Mismatched operation instance", op, descriptor.getFrame().getOperation());
View Full Code Here

    public void findErrors_noHttpFrame() {
        SimpleFrameBuilder builder = new SimpleFrameBuilder();
        Operation op = new Operation();
        builder.enter(op);
        Frame frame = builder.exit();
        Trace trace = Trace.newInstance(ApplicationName.valueOf("app"), TraceId.valueOf("0"), frame);
        assertTrue(analyzer.locateErrors(trace).isEmpty());
    }
View Full Code Here

        assertTrue(analyzer.locateErrors(trace).isEmpty());
    }

    @Test
    public void findErrors_noErrors() {
        Trace trace = createHttpTrace(200, true);
        assertTrue(analyzer.locateErrors(trace).isEmpty());
    }
View Full Code Here

        assertTrue(analyzer.locateErrors(trace).isEmpty());
    }

    @Test
    public void findErrors() {
        Trace trace = createHttpTrace(503, true);
        List<TraceError> errors = analyzer.locateErrors(trace);
        assertEquals(1, errors.size());
        TraceError error = errors.get(0);
        assertTrue(error.getMessage().contains("503"));
    }
View Full Code Here

        assertTrue(error.getMessage().contains("503"));
    }

    @Test
    public void findContextNotAvailableErrors() {
        Trace trace = createHttpTrace(200, false);
        List<TraceError> errors = analyzer.locateErrors(trace);
        assertEquals(1, errors.size());
        TraceError error = errors.get(0);
        assertTrue(error.getMessage().contains("Context not available"));
    }
View Full Code Here

        super();
    }

    @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

        assertEquals("Mismatched score", LifecycleEndPointAnalyzer.ANALYSIS_SCORE, analysis.getScore());
    }

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

TOP

Related Classes of com.springsource.insight.intercept.trace.Trace

Copyright © 2018 www.massapicom. 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.