Package com.springsource.insight.intercept.trace

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


        assertEquals("Mismatched port", port, op.getInt(SocketDefinitions.PORT_ATTR, (-1)));
        return op;
    }

    protected Operation runExternalResourceAnalyzer(Operation op, ExternalResourceType expType, String expAddress, int expPort) {
        Frame frame = new SimpleFrame(FrameId.valueOf("1"), null, op,
                TimeRange.milliTimeRange(0, 1L),
                Collections.<Frame>emptyList());
        Trace trace = new Trace(ServerName.valueOf("fake-server"),
                ApplicationName.valueOf("fake-app"),
                new Date(System.currentTimeMillis()),
View Full Code Here


        assertEquals("Mismatched error text", StringFormatterUtils.formatStackTrace(exc), err.getMessage());
        return errors;
    }

    protected static ExternalResourceDescriptor assertExternalResource(Operation op) {
        Frame frame = createMockOperationWrapperFrame(op);
        ExternalResourceDescriptor desc = extresAnalyzer.extractExternalResourceDescriptor(frame);
        Boolean directCall = op.get(HttpInvokerRequestExecutorExternalResourceAnalyzer.DIRECT_CALL_ATTR, Boolean.class);
        if ((directCall != null) && directCall.booleanValue()) {
            String label = TEST_HOST + ":" + TEST_PORT;
            assertNotNull("No resource", desc);
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);
View Full Code Here

    @Test
    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

                .put(OperationFields.CONTEXT_AVAILABLE, available)
                .put("servletName", "My stuff / servlet");
        httpOp.createMap("response")
                .put("statusCode", statusCode);
        builder.enter(httpOp);
        Frame httpFrame = builder.exit();
        return Trace.newInstance(ApplicationName.valueOf("app"), TraceId.valueOf("0"), httpFrame);
    }
View Full Code Here

    }

    private Trace createNonLifecycleTrace() {
        SimpleFrameBuilder builder = new SimpleFrameBuilder();
        builder.enter(new Operation());
        Frame topLevelFrame = builder.exit();
        return Trace.newInstance(app, TraceId.valueOf("0"), topLevelFrame);
    }
View Full Code Here

        Operation operation = new Operation()
                .type(LifecycleEndPointAnalyzer.SERVLET_LISTENER_TYPE)
                .put("event", "start");
        SimpleFrameBuilder builder = new SimpleFrameBuilder();
        builder.enter(operation);
        Frame httpFrame = builder.exit();
        return Trace.newInstance(app, TraceId.valueOf("0"), httpFrame);
    }
View Full Code Here

        return INSTANCE;
    }

    @Override
    public Collection<Frame> locateFrames(Trace trace) {
        Frame frame = trace.getFirstFrameOfType(getOperationType());
        if (frame == null) {
            return Collections.emptyList();
        } else {
            return Collections.singletonList(frame);
        }
View Full Code Here

    public List<MetricsBag> generateMetrics(Trace trace, ResourceKey endpointResourceKey, Collection<Frame> frames) {
        if (ListUtil.size(frames) != 1) {
            return Collections.emptyList();
        }

        Frame frame = ListUtil.getFirstMember(frames);
        Operation op = frame.getOperation();
        ResourceKey resourceKey = getResourceKey(op, endpointResourceKey);
        TimeRange range = trace.getRange();
        int time = TimeUtil.nanosToSeconds(range.getStart());
        MetricsBag mb = MetricsBag.create(resourceKey, range);
View Full Code Here

TOP

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

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.