Package org.mule.management.stats

Examples of org.mule.management.stats.ServiceStatistics


    }

    @Override
    protected ServiceStatistics createStatistics()
    {
        return new ServiceStatistics(getName(), threadingProfile.getMaxThreadsActive());
    }
View Full Code Here


        this.service = service;
    }

    public MuleEvent process(MuleEvent event) throws MuleException
    {
        ServiceStatistics stats = service.getStatistics();
        if (stats.isEnabled())
        {
            if (!(service.getOutboundMessageProcessor() instanceof OutboundRouterCollection)
                || (service.getOutboundMessageProcessor() instanceof OutboundRouterCollection && ((OutboundRouterCollection) service.getOutboundMessageProcessor()).hasEndpoints()))
            {
                if (event.getExchangePattern().hasResponse())
                {
                    stats.incSentEventSync();
                }
                else
                {
                    stats.incSentEventASync();
                }
            }
        }

        return event;
View Full Code Here

        super.doTearDown();
    }

    public void testCorrectAverageQueueSize() throws Exception
    {
        ServiceStatistics stats = getServiceStatistics();
        assertEquals(1, stats.getAverageQueueSize());
    }
View Full Code Here

        assertEquals(1, stats.getAverageQueueSize());
    }

    public void testCorrectAsynchEventsReceived() throws Exception
    {
        ServiceStatistics stats = getServiceStatistics();
        assertEquals(1, stats.getAsyncEventsReceived());
        FlowConstructStatistics fstats = getFlowConstructStatistics();
        assertEquals(2, fstats.getAsyncEventsReceived());
        ApplicationStatistics astats = getApplicationStatistics();
        assertEquals(3, astats.getAsyncEventsReceived());
    }
View Full Code Here

        assertEquals(3, astats.getAsyncEventsReceived());
    }

    public void testCorrectMaxQueueSize() throws Exception
    {
        ServiceStatistics stats = getServiceStatistics();
        assertEquals(1, stats.getMaxQueueSize());
    }
View Full Code Here

        assertEquals(1, stats.getMaxQueueSize());
    }

    public void testCorrectAsynchEventsSent() throws Exception
    {
        ServiceStatistics stats = getServiceStatistics();
        assertEquals(1, stats.getAsyncEventsSent());
    }
View Full Code Here

        assertEquals(1, stats.getAsyncEventsSent());
    }

    public void testCorrectTotalEventsSent() throws Exception
    {
        ServiceStatistics stats = getServiceStatistics();
        assertEquals(1, stats.getTotalEventsSent());
    }
View Full Code Here

        assertEquals(1, stats.getTotalEventsSent());
    }

    public void testCorrectTotalEventsReceived() throws Exception
    {
        ServiceStatistics stats = getServiceStatistics();
        assertEquals(1, stats.getTotalEventsReceived());
        FlowConstructStatistics fstats = getFlowConstructStatistics();
        assertEquals(2, fstats.getTotalEventsReceived());
        ApplicationStatistics astats = getApplicationStatistics();
        assertEquals(3, astats.getTotalEventsReceived());
    }
View Full Code Here

    {
        if (stats == null)
        {
            return;
        }
        ServiceStatistics serviceStats = (stats instanceof ServiceStatistics) ? (ServiceStatistics) stats : null;

        Arrays.fill(col, "-");

        col[0] = stats.getName();

        //TODO RM* Handling custom stats objects
        if (stats instanceof SedaServiceStatistics)
        {
            col[1] = ((SedaServiceStatistics) stats).getComponentPoolMaxSize() + "/"
                    + ((SedaServiceStatistics) stats).getComponentPoolAbsoluteMaxSize();
            col[2] = String.valueOf(((SedaServiceStatistics) stats).getComponentPoolSize());
        }
        else
        {
            col[1] = "-";
            col[2] = "-";
        }
        col[3] = String.valueOf(stats.getThreadPoolSize());
        if (serviceStats != null)
        {
            col[4] = String.valueOf(serviceStats.getQueuedEvents());
            col[5] = String.valueOf(serviceStats.getMaxQueueSize());
            col[6] = String.valueOf(serviceStats.getAverageQueueSize());
        }
        col[7] = String.valueOf(stats.getSyncEventsReceived());
        col[8] = String.valueOf(stats.getAsyncEventsReceived());
        col[9] = String.valueOf(stats.getTotalEventsReceived());
        if (serviceStats != null)
        {
            col[10] = String.valueOf(serviceStats.getSyncEventsSent());
            col[11] = String.valueOf(serviceStats.getAsyncEventsSent());
            col[12] = String.valueOf(serviceStats.getReplyToEventsSent());
            col[13] = String.valueOf(serviceStats.getTotalEventsSent());
        }

        if (serviceStats != null)
        {
            col[14] = String.valueOf(serviceStats.getExecutedEvents());
        }
        col[15] = String.valueOf(stats.getExecutionErrors());
        col[16] = String.valueOf(stats.getFatalErrors());
        if (serviceStats != null)
        {
            col[17] = String.valueOf(serviceStats.getMinExecutionTime());
            col[18] = String.valueOf(serviceStats.getMaxExecutionTime());
            col[19] = String.valueOf(serviceStats.getAverageExecutionTime());
            col[20] = String.valueOf(serviceStats.getTotalExecutionTime());
        }

        col[21] = String.valueOf(stats.getProcessedEvents());
        col[22] = String.valueOf(stats.getMinProcessingTime());
        col[23] = String.valueOf(stats.getMaxProcessingTime());
        col[24] = String.valueOf(stats.getAverageProcessingTime());
        col[25] = String.valueOf(stats.getTotalProcessingTime());

        if (serviceStats != null)
        {
            int i = getRouterInfo(serviceStats.getInboundRouterStat(), col, 26);
            i = getRouterInfo(serviceStats.getOutboundRouterStat(), col, i);
        }

        col[40] = String.valueOf(stats.getSamplePeriod());
    }
View Full Code Here

    protected abstract void addMessageProcessors(MessageProcessorChainBuilder builder);

    protected ServiceStatistics createStatistics()
    {
        return new ServiceStatistics(name);
    }
View Full Code Here

TOP

Related Classes of org.mule.management.stats.ServiceStatistics

Copyright © 2018 www.massapicom. 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.