Package org.apache.excalibur.instrument

Examples of org.apache.excalibur.instrument.ValueInstrument


        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

     * 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

        m_childList = new ArrayList();

        // Create the instruments
        setInstrumentableName( referenceName );
        addInstrument( m_instrumentRequests = new CounterInstrument( "requests" ) );
        addInstrument( m_instrumentTime = new ValueInstrument( "time" ) );
    }
View Full Code Here

        m_childList = new ArrayList();

        // Create the instruments
        setInstrumentableName( referenceName );
        addInstrument( m_instrumentRequests = new CounterInstrument( "requests" ) );
        addInstrument( m_instrumentTime = new ValueInstrument( "time" ) );
    }
View Full Code Here

     */
    public ComponentHandler()
    {
        // Initialize the Instrumentable elements.
        setInstrumentableName( ExcaliburComponentManager.INSTRUMENTABLE_NAME + ".unnamed handler" );
        addInstrument( m_referencesInstrument = new ValueInstrument( "references" ) );
        addInstrument( m_getsInstrument = new CounterInstrument( "gets" ) );
        addInstrument( m_putsInstrument = new CounterInstrument( "puts" ) );
    }
View Full Code Here

        {
            m_oldReady = new LinkedList();
        }

        // Initialize the Instrumentable elements.
        m_sizeInstrument = new ValueInstrument( INSTRUMENT_SIZE_NAME );
        m_readySizeInstrument = new ValueInstrument( INSTRUMENT_READY_SIZE_NAME );
        m_getsInstrument = new CounterInstrument( INSTRUMENT_GETS_NAME );
        m_putsInstrument = new CounterInstrument( INSTRUMENT_PUTS_NAME );
        m_blocksInstrument = new CounterInstrument( INSTRUMENT_BLOCKS_NAME );
        m_createsInstrument = new CounterInstrument( INSTRUMENT_CREATES_NAME );
        m_decommissionsInstrument = new CounterInstrument( INSTRUMENT_DECOMMISSIONS_NAME );
View Full Code Here

        m_port = port;
        m_bindAddr = bindAddress;
       
        // Create instruments
        m_instrumentConnects = new CounterInstrument( "connects" );
        m_instrumentOpenSockets = new ValueInstrument( "open-sockets" );
        m_instrumentDisconnects = new CounterInstrument( "disconnects" );
        addInstrument( m_instrumentConnects );
        addInstrument( m_instrumentOpenSockets );
        addInstrument( m_instrumentDisconnects );
    }
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.