Search in sources :

Example 6 with LoadQueuesState

use of com.axway.ats.log.autodb.LoadQueuesState in project ats-framework by Axway.

the class DbEventRequestProcessor method startCheckpoint.

private void startCheckpoint(StartCheckpointEvent startCheckpointEvent) throws LoggingException {
    // check if checkpoints are enabled at all
    if (appenderConfig.getEnableCheckpoints()) {
        LoadQueuesState loadQueuesState = eventProcessorState.getLoadQueuesState();
        int loadQueueId = loadQueuesState.getLoadQueueIdForThread(startCheckpointEvent.getThread());
        if (loadQueueId > 0) {
            final int testcaseId = eventProcessorState.getTestCaseId();
            if (!deletedTestcases.contains(testcaseId)) {
                try {
                    CheckpointInfo startedCheckpointInfo = dbAccess.startCheckpoint(startCheckpointEvent.getName(), startCheckpointEvent.getThread(), startCheckpointEvent.getStartTimestamp(), startCheckpointEvent.getTransferUnit(), loadQueueId, true);
                    loadQueuesState.startCheckpoint(startedCheckpointInfo, startCheckpointEvent.getThread());
                } catch (LoggingException e) {
                    handleDeletedTestcase(e, testcaseId);
                }
            }
        }
    }
}
Also used : LoadQueuesState(com.axway.ats.log.autodb.LoadQueuesState) LoggingException(com.axway.ats.log.autodb.exceptions.LoggingException) CheckpointInfo(com.axway.ats.log.autodb.CheckpointInfo)

Example 7 with LoadQueuesState

use of com.axway.ats.log.autodb.LoadQueuesState in project ats-framework by Axway.

the class DbEventRequestProcessor method insertCheckpoint.

private void insertCheckpoint(InsertCheckpointEvent insertCheckpointEvent) throws LoggingException {
    // check if checkpoints are enabled at all
    if (appenderConfig.getEnableCheckpoints()) {
        LoadQueuesState loadQueuesState = eventProcessorState.getLoadQueuesState();
        int loadQueueId = loadQueuesState.getLoadQueueIdForThread(insertCheckpointEvent.getThread());
        final int testcaseId = eventProcessorState.getTestCaseId();
        if (!deletedTestcases.contains(testcaseId)) {
            try {
                dbAccess.insertCheckpoint(insertCheckpointEvent.getName(), insertCheckpointEvent.getStartTimestamp(), insertCheckpointEvent.getResponseTime(), insertCheckpointEvent.getTransferSize(), insertCheckpointEvent.getTransferUnit(), insertCheckpointEvent.getResult().toInt(), loadQueueId, true);
            } catch (LoggingException e) {
                handleDeletedTestcase(e, testcaseId);
            }
        }
    }
}
Also used : LoadQueuesState(com.axway.ats.log.autodb.LoadQueuesState) LoggingException(com.axway.ats.log.autodb.exceptions.LoggingException)

Aggregations

LoadQueuesState (com.axway.ats.log.autodb.LoadQueuesState)7 LoggingException (com.axway.ats.log.autodb.exceptions.LoggingException)3 CheckpointInfo (com.axway.ats.log.autodb.CheckpointInfo)2 LoadQueueAlreadyStartedException (com.axway.ats.log.autodb.exceptions.LoadQueueAlreadyStartedException)1