Examples of CountData


Examples of org.wso2.carbon.bam.data.publisher.servicestats.data.CountData

    @Override
    public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {

        try {

            CountData countData = StatisticsServiceComponent.getCountData();
            SystemStatisticsUtil systemStatisticsUtil = StatisticsServiceComponent.getSystemStatisticsUtil();
            EventingConfigData eventingConfigData = StatisticsServiceComponent.getServiceStatisticsPublisherAdmin()
                    .getEventingConfigData();

            if (eventingConfigData != null && eventingConfigData.eventingEnabled()
                    && eventingConfigData.getSystemRequestCountThreshold() > 0) {
                SystemStatistics systemStatistics = systemStatisticsUtil.getSystemStatistics(msgContext
                        .getConfigurationContext().getAxisConfiguration());

                if (msgContext.getAxisOperation() != null) {
                    OperationStatistics operationStatistics = systemStatisticsUtil.getOperationStatistics(
                            msgContext.getAxisOperation());
                    if (operationStatistics.getRequestCount() == 0) {
                        return InvocationResponse.CONTINUE;
                    }
                }//In very rare cases msgContext.getAxisOperation() becomes null, then we can't get statistics.
                else {
                    return InvocationResponse.CONTINUE;
                }

                Collection<ServiceStatisticData> latestServiceStats = updateAndGetLatestServiceStatistics(
                        systemStatisticsUtil,
                        countData,
                        msgContext);
                Collection<OperationStatisticData> latestOperationStats = updateAndGetLatestOperationStatistics(
                        systemStatisticsUtil,
                        countData,
                        msgContext);

                int lastCount = countData.getSystemCount();
                // Current hit count for system
                int currentCount = systemStatistics.getRequestCount();


                if (currentCount - lastCount > eventingConfigData.getSystemRequestCountThreshold()) {

                    countData.setSystemCount(currentCount);

                    getStatisticAndPublish(msgContext, systemStatistics, latestServiceStats, latestOperationStats);
                }

            }
View Full Code Here

Examples of org.wso2.carbon.bam.data.publisher.servicestats.data.CountData

            bundleContext.registerService(Axis2ConfigurationContextObserver.class.getName(),
                                          new ServiceStatisticsAxis2ConfigurationContextObserver(), null);

            serviceStatisticsPublisherAdmin = new ServiceStatisticsPublisherAdmin();

            countData = new CountData();

            //use event publisher as the serviceStatsProcessor
            ServiceStatsProcessor serviceStatsProcessor = new EventPublisher();
            serviceStatisticsQueue = new ServiceStatisticsQueue(serviceStatsProcessor);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.