Search in sources :

Example 1 with HasStatistics

use of nl.nn.adapterframework.statistics.HasStatistics in project iaf by ibissource.

the class Adapter method doForEachStatisticsKeeperBody.

private void doForEachStatisticsKeeperBody(StatisticsKeeperIterationHandler hski, Object adapterData, int action) throws SenderException {
    hski.handleScalar(adapterData, "messagesInProcess", getNumOfMessagesInProcess());
    hski.handleScalar(adapterData, "messagesProcessed", getNumOfMessagesProcessed());
    hski.handleScalar(adapterData, "messagesInError", getNumOfMessagesInError());
    hski.handleScalar(adapterData, "messagesProcessedThisInterval", numOfMessagesProcessed.getIntervalValue());
    hski.handleScalar(adapterData, "messagesInErrorThisInterval", numOfMessagesInError.getIntervalValue());
    hski.handleStatisticsKeeper(adapterData, statsMessageProcessingDuration);
    statsMessageProcessingDuration.performAction(action);
    numOfMessagesProcessed.performAction(action);
    numOfMessagesInError.performAction(action);
    Object hourData = hski.openGroup(adapterData, getName(), "processing by hour");
    for (int i = 0; i < getNumOfMessagesStartProcessingByHour().length; i++) {
        String startTime;
        if (i < 10) {
            startTime = "0" + i + ":00";
        } else {
            startTime = i + ":00";
        }
        hski.handleScalar(hourData, startTime, getNumOfMessagesStartProcessingByHour()[i]);
    }
    hski.closeGroup(hourData);
    boolean showDetails = action == HasStatistics.STATISTICS_ACTION_FULL || action == HasStatistics.STATISTICS_ACTION_MARK_FULL || action == HasStatistics.STATISTICS_ACTION_RESET;
    if (showDetails) {
        Object recsData = hski.openGroup(adapterData, null, "receivers");
        Iterator<IReceiver> recIt = getReceiverIterator();
        if (recIt.hasNext()) {
            while (recIt.hasNext()) {
                IReceiver receiver = recIt.next();
                receiver.iterateOverStatistics(hski, recsData, action);
            }
        }
        hski.closeGroup(recsData);
        ICacheAdapter cache = pipeline.getCache();
        if (cache != null && cache instanceof HasStatistics) {
            ((HasStatistics) cache).iterateOverStatistics(hski, recsData, action);
        }
        Object pipelineData = hski.openGroup(adapterData, null, "pipeline");
        getPipeLine().iterateOverStatistics(hski, pipelineData, action);
        hski.closeGroup(pipelineData);
    }
}
Also used : ICacheAdapter(nl.nn.adapterframework.cache.ICacheAdapter) HasStatistics(nl.nn.adapterframework.statistics.HasStatistics)

Example 2 with HasStatistics

use of nl.nn.adapterframework.statistics.HasStatistics in project iaf by ibissource.

the class PipeLine method handlePipeStat.

private void handlePipeStat(INamedObject pipe, Map<String, StatisticsKeeper> pipelineStatistics, Object pipeStatsData, StatisticsKeeperIterationHandler handler, boolean deep, int action) throws SenderException {
    if (pipe == null) {
        return;
    }
    StatisticsKeeper pstat = pipelineStatistics.get(pipe.getName());
    handler.handleStatisticsKeeper(pipeStatsData, pstat);
    if (deep && pipe instanceof HasStatistics) {
        ((HasStatistics) pipe).iterateOverStatistics(handler, pipeStatsData, action);
    }
}
Also used : SizeStatisticsKeeper(nl.nn.adapterframework.statistics.SizeStatisticsKeeper) StatisticsKeeper(nl.nn.adapterframework.statistics.StatisticsKeeper) HasStatistics(nl.nn.adapterframework.statistics.HasStatistics)

Example 3 with HasStatistics

use of nl.nn.adapterframework.statistics.HasStatistics in project iaf by ibissource.

the class SenderSeries method iterateOverStatistics.

public void iterateOverStatistics(StatisticsKeeperIterationHandler hski, Object data, int action) throws SenderException {
    // Object senderData=hski.openGroup(data,getName(),"sender");
    for (Iterator<ISender> it = getSenderIterator(); it.hasNext(); ) {
        ISender sender = it.next();
        hski.handleStatisticsKeeper(data, getStatisticsKeeper(sender));
        if (sender instanceof HasStatistics) {
            ((HasStatistics) sender).iterateOverStatistics(hski, data, action);
        }
    }
// hski.closeGroup(senderData);
}
Also used : ISender(nl.nn.adapterframework.core.ISender) HasStatistics(nl.nn.adapterframework.statistics.HasStatistics)

Aggregations

HasStatistics (nl.nn.adapterframework.statistics.HasStatistics)3 ICacheAdapter (nl.nn.adapterframework.cache.ICacheAdapter)1 ISender (nl.nn.adapterframework.core.ISender)1 SizeStatisticsKeeper (nl.nn.adapterframework.statistics.SizeStatisticsKeeper)1 StatisticsKeeper (nl.nn.adapterframework.statistics.StatisticsKeeper)1