Examples of ResponseTimeProcessor


Examples of org.wso2.carbon.bam.data.publisher.clientstats.ResponseTimeProcessor

                                    globalReqCount, msgContext);
                        }
                    }

                    // handle Service response time
                    ResponseTimeProcessor proc = new ResponseTimeProcessor();
                    if (service != null) {
                        Object responseTimeProcessorObj = null;
                        Object serviceCountObj = msgContext
                                .getConfigurationContext()
                                .getProperty(
                                        ClientStatisticsPublisherConstants.BAM_USER_DEFINED_SERVICE_REQUEST_COUNTER_PROPERTY);
                        try {
                       responseTimeProcessorObj = msgContext
                                .getConfigurationContext()
                                .getProperty(
                                        ClientStatisticsPublisherConstants.BAM_USER_DEFINED_SERVICE_RESPONSE_TIME_PROCESSOR_PROPERTY);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        int serviceCount = 0;
                        if (serviceCountObj != null) {
                            if (serviceCountObj instanceof Counter) {
                            serviceCount = ((Counter) serviceCountObj).getCount();
                            }
                        }
                        if (responseTimeProcessorObj != null) {
                            proc.addResponseTime(responseTime, serviceCount, msgContext);
                        } else {

                            proc.addResponseTime(responseTime, serviceCount, msgContext);
                            msgContext
                                    .getConfigurationContext()
                                    .setProperty(
                                            ClientStatisticsPublisherConstants.BAM_USER_DEFINED_SERVICE_RESPONSE_TIME_PROCESSOR_PROPERTY,
                                            proc);
                        }
                    }

                    // Handle operation response time

                    if (operation != null) {
                        Object opeResTimeprocessorObj = msgContext
                                .getConfigurationContext()
                                .getProperty(
                                        ClientStatisticsPublisherConstants.BAM_USER_DEFINED_OPERATION_RESPONSE_TIME_PROCESSOR_PROPERTY);
                        Object opReqCounterObj = msgContext
                                .getConfigurationContext()
                                .getProperty(
                                        ClientStatisticsPublisherConstants.BAM_USER_DEFINED_IN_OPERATION_COUNTER_PROPERTY);
                        int opReqCount = 0;
                        if (opReqCounterObj != null) {
                            if (opReqCounterObj instanceof Counter) {
                            opReqCount = ((Counter) opReqCounterObj).getCount();
                            }
                        }
                        if (opeResTimeprocessorObj != null) {
                            proc.addResponseTime(responseTime, opReqCount, msgContext);
                        } else {
                            proc.addResponseTime(responseTime, opReqCount, msgContext);
                            msgContext
                                    .getConfigurationContext()
                                    .setProperty(
                                            ClientStatisticsPublisherConstants.BAM_USER_DEFINED_OPERATION_RESPONSE_TIME_PROCESSOR_PROPERTY,
                                            proc);
View Full Code Here

Examples of org.wso2.carbon.statistics.internal.ResponseTimeProcessor

            globalFaultCounterParam.setValue(globalFaultCounter);
            axisConfig.addParameter(globalFaultCounterParam);
        }

        {
            ResponseTimeProcessor responseTimeProcessor = new ResponseTimeProcessor();
            Parameter responseTimeProcessorParam = new Parameter();
            responseTimeProcessorParam.setName(StatisticsConstants.RESPONSE_TIME_PROCESSOR);
            responseTimeProcessorParam.setValue(responseTimeProcessor);
            axisConfig.addParameter(responseTimeProcessorParam);
        }
View Full Code Here

Examples of org.wso2.carbon.statistics.internal.ResponseTimeProcessor

    public long getMaxServiceResponseTime(AxisService axisService) throws AxisFault {
        long max = 0;
        Parameter parameter =
                axisService.getParameter(StatisticsConstants.SERVICE_RESPONSE_TIME_PROCESSOR);
        if (parameter != null) {
            ResponseTimeProcessor proc = (ResponseTimeProcessor) parameter.getValue();
            max = proc.getMaxResponseTime();
        }
        return max;
    }
View Full Code Here

Examples of org.wso2.carbon.statistics.internal.ResponseTimeProcessor

    public long getMinServiceResponseTime(AxisService axisService) throws AxisFault {
        long min = 0;
        Parameter parameter =
                axisService.getParameter(StatisticsConstants.SERVICE_RESPONSE_TIME_PROCESSOR);
        if (parameter != null) {
            ResponseTimeProcessor proc = (ResponseTimeProcessor) parameter.getValue();
            min = proc.getMinResponseTime();
        }
        if (min == -1) {
            min = 0;
        }
        return min;
View Full Code Here

Examples of org.wso2.carbon.statistics.internal.ResponseTimeProcessor

    public double getAvgServiceResponseTime(AxisService axisService) throws AxisFault {
        double avg = 0;
        Parameter parameter =
                axisService.getParameter(StatisticsConstants.SERVICE_RESPONSE_TIME_PROCESSOR);
        if (parameter != null) {
            ResponseTimeProcessor proc = (ResponseTimeProcessor) parameter.getValue();
            avg = proc.getAvgResponseTime();
        }
        return avg;
    }
View Full Code Here

Examples of org.wso2.carbon.statistics.internal.ResponseTimeProcessor

                }

                // Operation response time processor
                Parameter responseTimeProcessor = new Parameter();
                responseTimeProcessor.setName(StatisticsConstants.OPERATION_RESPONSE_TIME_PROCESSOR);
                responseTimeProcessor.setValue(new ResponseTimeProcessor());
                try {
                    op.addParameter(responseTimeProcessor);
                } catch (AxisFault axisFault) { // will not occur
                }
            }

            // Service response time processor
            Parameter responseTimeProcessor = new Parameter();
            responseTimeProcessor.setName(StatisticsConstants.SERVICE_RESPONSE_TIME_PROCESSOR);
            responseTimeProcessor.setValue(new ResponseTimeProcessor());
            try {
                axisService.addParameter(responseTimeProcessor);
            } catch (AxisFault axisFault) { // will not occur
            }
        }
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.