Package org.apache.excalibur.instrument

Examples of org.apache.excalibur.instrument.CounterInstrument


        ci.increment( 1 );
    }
   
    public void testCount1IncrementDisconnected() throws Exception
    {
        CounterInstrument ci = new CounterInstrument( "testInstrument" );
        assertEquals( "A disconnected instrument should not be active.", ci.isActive(), false );
       
        ci.increment( 1 );
    }
View Full Code Here


        ci.increment( 1 );
    }
   
    public void testCount0IncrementDisconnected() throws Exception
    {
        CounterInstrument ci = new CounterInstrument( "testInstrument" );
        try
        {
            ci.increment( 0 );
            fail( "calling increment with a count of 0 should fail." );
        }
        catch ( IllegalArgumentException e )
        {
            // Ok
View Full Code Here

        }
    }
   
    public void testCountNegIncrementDisconnected() throws Exception
    {
        CounterInstrument ci = new CounterInstrument( "testInstrument" );
        try
        {
            ci.increment( -1 );
            fail( "calling increment with a negative count should fail." );
        }
        catch ( IllegalArgumentException e )
        {
            // Ok
View Full Code Here

        }
    }
   
    public void testSimpleIncrementConnectedInactive() throws Exception
    {
        CounterInstrument ci = new CounterInstrument( "testInstrument" );
        TestInstrumentProxy proxy = new TestInstrumentProxy();
        ci.setInstrumentProxy( proxy );
       
        assertEquals( "The instrument should not be active.", ci.isActive(), false );
       
        ci.increment();
       
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 1 );
       
        ci.increment();
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 2 );
    }
View Full Code Here

        assertEquals( "The expected count was incorrect.", proxy.getValue(), 2 );
    }
   
    public void testCount1IncrementConnectedInactive() throws Exception
    {
        CounterInstrument ci = new CounterInstrument( "testInstrument" );
        TestInstrumentProxy proxy = new TestInstrumentProxy();
        ci.setInstrumentProxy( proxy );
       
        assertEquals( "The instrument should not be active.", ci.isActive(), false );
       
        ci.increment( 1 );
       
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 1 );
       
        ci.increment( 2 );
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 3 );
    }
View Full Code Here

        assertEquals( "The expected count was incorrect.", proxy.getValue(), 3 );
    }
   
    public void testSimpleIncrementConnectedActive() throws Exception
    {
        CounterInstrument ci = new CounterInstrument( "testInstrument" );
        TestInstrumentProxy proxy = new TestInstrumentProxy();
        ci.setInstrumentProxy( proxy );
        proxy.activate();
       
        assertEquals( "The instrument should br active.", ci.isActive(), true );
       
        ci.increment();
       
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 1 );
    }
View Full Code Here

        assertEquals( "The expected count was incorrect.", proxy.getValue(), 1 );
    }
   
    public void testCount1IncrementConnectedActive() throws Exception
    {
        CounterInstrument ci = new CounterInstrument( "testInstrument" );
        TestInstrumentProxy proxy = new TestInstrumentProxy();
        ci.setInstrumentProxy( proxy );
        proxy.activate();

        assertEquals( "The instrument should br active.", ci.isActive(), true );
       
        ci.increment( 1 );
       
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 1 );
    }
View Full Code Here

        m_loggerManager = loggerManager;
        m_extManager = extManager;
        enableLogging( m_loggerManager.getLoggerForCategory( "system.factory" ) );
        m_componentLogger = aquireLogger();

        m_newInstance = new CounterInstrument( "creates" );
        m_dispose = new CounterInstrument( "destroys" );

        setInstrumentableName( "factory" );

        addInstrument( m_newInstance );
        addInstrument( m_dispose );
View Full Code Here

        continuationsCount = new ValueInstrument("count");
        continuationsCounter = 0;
        forestSize = new ValueInstrument("forest-size");
        expirationsSize = new ValueInstrument("expirations-size");
        continuationsCreated = new CounterInstrument("creates");
        continuationsInvalidated = new CounterInstrument("invalidates");
    }
View Full Code Here

    {
        m_path = path;
        m_contentType = contentType;
        m_encoding = encoding;
       
        addInstrument( m_instrumentRequests = new CounterInstrument( "requests" ) );
        addInstrument( m_instrumentRequestTime = new ValueInstrument( "request-time" ) );
    }
View Full Code Here

TOP

Related Classes of org.apache.excalibur.instrument.CounterInstrument

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.