Search in sources :

Example 1 with SessionEndEvent

use of org.iobserve.common.record.SessionEndEvent in project iobserve-analysis by research-iobserve.

the class SessionCollectorListener method sessionDestroyed.

@Override
public void sessionDestroyed(final HttpSessionEvent event) {
    if (this.monitoringCtrl.isMonitoringEnabled()) {
        final String session = event.getSession().getId();
        final String hostname = event.getSession().getServletContext().getVirtualServerName();
        final long time = this.timeSource.getTime();
        // if (this.monitoringCtrl.isProbeActivated(signature)) {
        this.monitoringCtrl.newMonitoringRecord(new SessionEndEvent(time, hostname, session));
    // }
    }
}
Also used : SessionEndEvent(org.iobserve.common.record.SessionEndEvent)

Example 2 with SessionEndEvent

use of org.iobserve.common.record.SessionEndEvent in project iobserve-analysis by research-iobserve.

the class DynamicEventDispatcherTest method initializeRecordSwitch.

/**
 * Initialize the record switch test setup.
 */
@Before
public void initializeRecordSwitch() {
    this.kiekerMetadataRecords.add(new KiekerMetadataRecord(DynamicEventDispatcherTest.VERSION, DynamicEventDispatcherTest.CONTROLLER_NAME, DynamicEventDispatcherTest.HOSTNAME, DynamicEventDispatcherTest.EXPERIMENT_ID, DynamicEventDispatcherTest.DEBUG_MODE, DynamicEventDispatcherTest.TIME_OFFSET, DynamicEventDispatcherTest.TIME_UNIT, DynamicEventDispatcherTest.NUMBER_OF_RECORDS));
    /**
     * allocation.
     */
    this.allocationRecords.add(new ContainerAllocationEvent(DynamicEventDispatcherTest.URL));
    /**
     * declare deployment records.
     */
    this.deploymentRecords.add(new ServletDeployedEvent(this.time++, DynamicEventDispatcherTest.SERVICE, DynamicEventDispatcherTest.CONTEXT, DynamicEventDispatcherTest.DEPLOYMENT_ID));
    this.deploymentRecords.add(new EJBDeployedEvent(this.time++, DynamicEventDispatcherTest.SERVICE, DynamicEventDispatcherTest.CONTEXT, DynamicEventDispatcherTest.DEPLOYMENT_ID));
    /**
     * geolocation.
     */
    this.geolocationRecords.add(new ServerGeoLocation(this.time++, DynamicEventDispatcherTest.COUNTRY_CODE, DynamicEventDispatcherTest.HOSTNAME, DynamicEventDispatcherTest.ADDRESS));
    /**
     * session event (start).
     */
    final SessionStartEvent sessionStartEvent = new SessionStartEvent(this.time++, DynamicEventDispatcherTest.HOSTNAME, DynamicEventDispatcherTest.SESSION_ID);
    this.sessionEventRecords.add(sessionStartEvent);
    /**
     * start trace.
     */
    final TraceMetadata traceMetadata = new TraceMetadata(DynamicEventDispatcherTest.TRACE_ID, DynamicEventDispatcherTest.THREAD_ID, DynamicEventDispatcherTest.SESSION_ID, DynamicEventDispatcherTest.HOSTNAME, 0, -1);
    this.traceMetadataRecords.add(traceMetadata);
    this.flowRecords.add(traceMetadata);
    /**
     * flow record.
     */
    this.flowRecords.add(new BeforeOperationEvent(this.time++, DynamicEventDispatcherTest.TRACE_ID, DynamicEventDispatcherTest.ORDER_INDEX, DynamicEventDispatcherTest.OPERATION_SIGNATURE, DynamicEventDispatcherTest.CLASS_SIGNATURE));
    this.flowRecords.add(new AfterOperationEvent(this.time++, DynamicEventDispatcherTest.TRACE_ID, DynamicEventDispatcherTest.ORDER_INDEX + 1, DynamicEventDispatcherTest.OPERATION_SIGNATURE, DynamicEventDispatcherTest.CLASS_SIGNATURE));
    /**
     * session event (end).
     */
    final SessionEndEvent sessionEndEvent = new SessionEndEvent(this.time++, DynamicEventDispatcherTest.HOSTNAME, DynamicEventDispatcherTest.SESSION_ID);
    this.sessionEventRecords.add(sessionEndEvent);
    /**
     * declare undeployment records.
     */
    this.undeploymentRecords.add(new ServletUndeployedEvent(this.time++, DynamicEventDispatcherTest.SERVICE, DynamicEventDispatcherTest.CONTEXT, DynamicEventDispatcherTest.DEPLOYMENT_ID));
    this.undeploymentRecords.add(new EJBUndeployedEvent(this.time++, DynamicEventDispatcherTest.SERVICE, DynamicEventDispatcherTest.CONTEXT, DynamicEventDispatcherTest.DEPLOYMENT_ID));
    /**
     * allocation.
     */
    this.deallocationRecords.add(new ContainerDeallocationEvent(DynamicEventDispatcherTest.URL));
    /**
     * other records.
     */
    this.otherRecords.add(new GCRecord(this.time++, DynamicEventDispatcherTest.HOSTNAME, DynamicEventDispatcherTest.VM_NAME, DynamicEventDispatcherTest.GC_NAME, DynamicEventDispatcherTest.COLLECTION_COUNT, DynamicEventDispatcherTest.COLLECTION_TIME_MS));
    /**
     * declare all input record types.
     */
    this.inputRecords.addAll(this.kiekerMetadataRecords);
    this.inputRecords.addAll(this.allocationRecords);
    this.inputRecords.addAll(this.deploymentRecords);
    this.inputRecords.addAll(this.geolocationRecords);
    this.inputRecords.add(sessionStartEvent);
    this.inputRecords.addAll(this.flowRecords);
    this.inputRecords.add(sessionEndEvent);
    this.inputRecords.addAll(this.undeploymentRecords);
    this.inputRecords.addAll(this.deallocationRecords);
    this.inputRecords.addAll(this.otherRecords);
}
Also used : AfterOperationEvent(kieker.common.record.flow.trace.operation.AfterOperationEvent) EJBDeployedEvent(org.iobserve.common.record.EJBDeployedEvent) KiekerMetadataRecord(kieker.common.record.misc.KiekerMetadataRecord) EJBUndeployedEvent(org.iobserve.common.record.EJBUndeployedEvent) ContainerDeallocationEvent(org.iobserve.common.record.ContainerDeallocationEvent) GCRecord(kieker.common.record.jvm.GCRecord) ServletUndeployedEvent(org.iobserve.common.record.ServletUndeployedEvent) SessionStartEvent(org.iobserve.common.record.SessionStartEvent) SessionEndEvent(org.iobserve.common.record.SessionEndEvent) ContainerAllocationEvent(org.iobserve.common.record.ContainerAllocationEvent) ServerGeoLocation(org.iobserve.common.record.ServerGeoLocation) TraceMetadata(kieker.common.record.flow.trace.TraceMetadata) ServletDeployedEvent(org.iobserve.common.record.ServletDeployedEvent) BeforeOperationEvent(kieker.common.record.flow.trace.operation.BeforeOperationEvent) Before(org.junit.Before)

Example 3 with SessionEndEvent

use of org.iobserve.common.record.SessionEndEvent in project iobserve-analysis by research-iobserve.

the class EntryCallSequence method execute.

@Override
protected void execute() {
    final ISessionEvent sessionEvent = this.sessionEventInputPort.receive();
    if (sessionEvent != null) {
        if (sessionEvent instanceof SessionStartEvent) {
            this.sessions.put(UserSession.createUserSessionId(sessionEvent), new UserSession(sessionEvent.getHostname(), sessionEvent.getSessionId()));
        }
        if (sessionEvent instanceof SessionEndEvent) {
            final UserSession session = this.sessions.get(UserSession.createUserSessionId(sessionEvent));
            if (session != null) {
                this.userSessionOutputPort.send(session);
                this.sessions.remove(sessionEvent.getSessionId());
            }
        }
    }
    final PayloadAwareEntryCallEvent event = this.entryCallInputPort.receive();
    if (event != null) {
        /**
         * add the event to the corresponding user session in case the user session is not yet
         * available, create one.
         */
        final String userSessionId = UserSession.createUserSessionId(event);
        UserSession userSession = this.sessions.get(userSessionId);
        if (userSession == null) {
            userSession = new UserSession(event.getHostname(), event.getSessionId());
            this.sessions.put(userSessionId, userSession);
        // TODO this should trigger a warning.
        }
        userSession.add(event, true);
    }
    this.removeExpiredSessions();
}
Also used : PayloadAwareEntryCallEvent(org.iobserve.stages.general.data.PayloadAwareEntryCallEvent) SessionStartEvent(org.iobserve.common.record.SessionStartEvent) SessionEndEvent(org.iobserve.common.record.SessionEndEvent) UserSession(org.iobserve.analysis.session.data.UserSession) ISessionEvent(org.iobserve.common.record.ISessionEvent)

Example 4 with SessionEndEvent

use of org.iobserve.common.record.SessionEndEvent in project iobserve-analysis by research-iobserve.

the class EndSessionDetector method flushAllRecords.

private void flushAllRecords() {
    for (final IMonitoringRecord event : this.allRecords) {
        if (event instanceof ITraceRecord) {
            final ITraceRecord traceEvent = (ITraceRecord) event;
            final Pair firstLast = this.getFirstLast(traceEvent);
            this.outputPort.send(event);
            if (firstLast != null) {
                if (firstLast.getLast() == traceEvent) {
                    this.outputPort.send(new SessionEndEvent(firstLast.getLast().getLoggingTimestamp(), firstLast.getFirst().getHostname(), firstLast.getFirst().getSessionId()));
                }
            }
        } else {
            this.outputPort.send(event);
        }
    }
    this.allRecords.clear();
}
Also used : SessionEndEvent(org.iobserve.common.record.SessionEndEvent) ITraceRecord(kieker.common.record.flow.ITraceRecord) IMonitoringRecord(kieker.common.record.IMonitoringRecord)

Aggregations

SessionEndEvent (org.iobserve.common.record.SessionEndEvent)4 SessionStartEvent (org.iobserve.common.record.SessionStartEvent)2 IMonitoringRecord (kieker.common.record.IMonitoringRecord)1 ITraceRecord (kieker.common.record.flow.ITraceRecord)1 TraceMetadata (kieker.common.record.flow.trace.TraceMetadata)1 AfterOperationEvent (kieker.common.record.flow.trace.operation.AfterOperationEvent)1 BeforeOperationEvent (kieker.common.record.flow.trace.operation.BeforeOperationEvent)1 GCRecord (kieker.common.record.jvm.GCRecord)1 KiekerMetadataRecord (kieker.common.record.misc.KiekerMetadataRecord)1 UserSession (org.iobserve.analysis.session.data.UserSession)1 ContainerAllocationEvent (org.iobserve.common.record.ContainerAllocationEvent)1 ContainerDeallocationEvent (org.iobserve.common.record.ContainerDeallocationEvent)1 EJBDeployedEvent (org.iobserve.common.record.EJBDeployedEvent)1 EJBUndeployedEvent (org.iobserve.common.record.EJBUndeployedEvent)1 ISessionEvent (org.iobserve.common.record.ISessionEvent)1 ServerGeoLocation (org.iobserve.common.record.ServerGeoLocation)1 ServletDeployedEvent (org.iobserve.common.record.ServletDeployedEvent)1 ServletUndeployedEvent (org.iobserve.common.record.ServletUndeployedEvent)1 PayloadAwareEntryCallEvent (org.iobserve.stages.general.data.PayloadAwareEntryCallEvent)1 Before (org.junit.Before)1