Package org.apache.excalibur.instrument

Examples of org.apache.excalibur.instrument.ValueInstrument


        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


            random = SecureRandom.getInstance("IBMSecureRandom");
        }
        random.setSeed(System.currentTimeMillis());
        bytes = new byte[CONTINUATION_ID_LENGTH];

        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

     * Creates a new DefaultInstrumentManagerImpl.
     */
    public DefaultInstrumentManagerImpl()
    {
        // Initialize the Instrumentable elements.
        m_totalMemoryInstrument = new ValueInstrument( "total-memory" );
        m_freeMemoryInstrument = new ValueInstrument( "free-memory" );
        m_memoryInstrument = new ValueInstrument( "memory" );
        m_activeThreadCountInstrument = new ValueInstrument( "active-thread-count" );
        m_registrationsInstrument = new CounterInstrument( "instrumentable-registrations" );
        m_instrumentablesInstrument = new ValueInstrument( "instrumentables" );
        m_instrumentsInstrument = new ValueInstrument( "instruments" );
        m_samplesInstrument = new ValueInstrument( "samples" );
        m_leasedSamplesInstrument = new ValueInstrument( "leased-samples" );
        m_leaseRequestsInstrument = new CounterInstrument( "lease-requests" );
        m_stateSavesInstrument = new CounterInstrument( "state-saves" );
        m_stateSaveTimeInstrument = new ValueInstrument( "state-save-time" );
    }
View Full Code Here

    public void testNInstrument() throws Exception
    {
        Instrument[] instruments = new Instrument[]
            {
                new CounterInstrument( "c1" ),
                new ValueInstrument( "v1" ),
                new CounterInstrument( "c2" ),
                new ValueInstrument( "v2" ),
                new CounterInstrument( "c3" ),
                new ValueInstrument( "v3" ),
                new CounterInstrument( "c4" ),
                new ValueInstrument( "v4" )
            };
        Instrumentable[] children = new Instrumentable[] {};
       
        generalTest( instruments, children );
    }
View Full Code Here

    public void testNInstrument() throws Exception
    {
        Instrument[] instruments = new Instrument[]
            {
                new CounterInstrument( "c1" ),
                new ValueInstrument( "v1" ),
                new CounterInstrument( "c2" ),
                new ValueInstrument( "v2" ),
                new CounterInstrument( "c3" ),
                new ValueInstrument( "v3" ),
                new CounterInstrument( "c4" ),
                new ValueInstrument( "v4" )
            };
        Instrumentable[] children = new Instrumentable[] {};
       
        generalTest( instruments, children );
    }
View Full Code Here

    /*---------------------------------------------------------------
     * Test Cases
     *-------------------------------------------------------------*/
    public void testSimpleValueDisconnected() throws Exception
    {
        ValueInstrument vi = new ValueInstrument( "testInstrument" );
       
        assertEquals( "A disconnected instrument should not be active.", vi.isActive(), false );
       
        vi.setValue( 0 );
        vi.setValue( -1 );
        vi.setValue( 1 );
    }
View Full Code Here

        vi.setValue( 1 );
    }
   
    public void testSimpleValueConnectedInactive() throws Exception
    {
        ValueInstrument vi = new ValueInstrument( "testInstrument" );
        TestInstrumentProxy proxy = new TestInstrumentProxy();
        vi.setInstrumentProxy( proxy );
       
        assertEquals( "The instrument should not be active.", vi.isActive(), false );
       
        vi.setValue( 0 );
        assertEquals( "The expected value was incorrect.", proxy.getValue(), 0 );
       
        vi.setValue( -1 );
        assertEquals( "The expected value was incorrect.", proxy.getValue(), -1 );
       
        vi.setValue( 1 );
        assertEquals( "The expected value was incorrect.", proxy.getValue(), 1 );
    }
View Full Code Here

        assertEquals( "The expected value was incorrect.", proxy.getValue(), 1 );
    }
   
    public void testLargeValueConnectedInactive() throws Exception
    {
        ValueInstrument vi = new ValueInstrument( "testInstrument" );
        TestInstrumentProxy proxy = new TestInstrumentProxy();
        vi.setInstrumentProxy( proxy );
       
        assertEquals( "The instrument should not be active.", vi.isActive(), false );
       
        vi.setValue( 1313123123 );
        assertEquals( "The expected value was incorrect.", proxy.getValue(), 1313123123 );
       
        vi.setValue( -325353253 );
        assertEquals( "The expected value was incorrect.", proxy.getValue(), -325353253 );
    }
View Full Code Here

        assertEquals( "The expected value was incorrect.", proxy.getValue(), -325353253 );
    }
   
    public void testSimpleValueConnectedActive() throws Exception
    {
        ValueInstrument vi = new ValueInstrument( "testInstrument" );
        TestInstrumentProxy proxy = new TestInstrumentProxy();
        vi.setInstrumentProxy( proxy );
        proxy.activate();
       
        assertEquals( "The instrument should br active.", vi.isActive(), true );
       
        vi.setValue( 0 );
        assertEquals( "The expected value was incorrect.", proxy.getValue(), 0 );
       
        vi.setValue( -1 );
        assertEquals( "The expected value was incorrect.", proxy.getValue(), -1 );
       
        vi.setValue( 1 );
        assertEquals( "The expected value was incorrect.", proxy.getValue(), 1 );
    }
View Full Code Here

        assertEquals( "The expected value was incorrect.", proxy.getValue(), 1 );
    }
   
    public void testLargeValueConnectedActive() throws Exception
    {
        ValueInstrument vi = new ValueInstrument( "testInstrument" );
        TestInstrumentProxy proxy = new TestInstrumentProxy();
        vi.setInstrumentProxy( proxy );
        proxy.activate();
       
        assertEquals( "The instrument should br active.", vi.isActive(), true );
       
        vi.setValue( 1313123123 );
        assertEquals( "The expected value was incorrect.", proxy.getValue(), 1313123123 );
       
        vi.setValue( -325353253 );
        assertEquals( "The expected value was incorrect.", proxy.getValue(), -325353253 );
    }
View Full Code Here

TOP

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

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.