Tabnine Logo
ValueInstrument
Code IndexAdd Tabnine to your IDE (free)

How to use
ValueInstrument
in
org.apache.excalibur.instrument

Best Java code snippets using org.apache.excalibur.instrument.ValueInstrument (Showing top 20 results out of 315)

origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

/**
 * Called to increment the number of Instrumentables registered.
 */
void incrementInstrumentableCount()
{
  int count;
  synchronized( m_semaphore )
  {
    count = ++m_instrumentableCount;
  }
  m_instrumentablesInstrument.setValue( count );
}

origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

/**
 * 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" );
}
origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

/**
 * Updates the Thread based Profile Points published by the InstrumentManager.
 */
private void threadInstruments()
{
  if( m_activeThreadCountInstrument.isActive() )
  {
    // Get the top level thread group.
    ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();
    ThreadGroup parent;
    while( ( parent = threadGroup.getParent() ) != null )
    {
      threadGroup = parent;
    }
    m_activeThreadCountInstrument.setValue( threadGroup.activeCount() );
  }
}

origin: org.apache.excalibur.containerkit/excalibur-instrument-api

  /**
   * Sets the current value of the Instrument.  This method is optimized
   *  to be extremely light weight when an InstrumentManager is not present
   *  and there are no registered ValueInstrumentListeners.
   * <p>
   * Note that in many cases is best to call this method even if the
   *  isActive() method returns false.  This is because the InstrumentManager
   *  will remember the last value set and use it if the instrument ever
   *  becomes active.  For things like pool sizes which do not change often,
   *  this behavior is critical so that users can begin monitoring the value
   *  and see what it was before they connected.   Setting the value is
   *  very light weight, but its calculation may not be.  It is up to the
   *  user to weigh the benefits and consequences one way or the other.
   *
   * @param value The new value for the Instrument.
   */
  public void setValue( int value )
  {
    InstrumentProxy proxy = getInstrumentProxy();
    if( proxy != null )
    {
      proxy.setValue( value );
    }
  }
}
origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

/**
 * Called to increment the number of Instruments registered.
 */
void incrementInstrumentCount()
{
  int count;
  synchronized( m_semaphore )
  {
    count = ++m_instrumentCount;
  }
  m_instrumentsInstrument.setValue( count );
}

origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

if( m_totalMemoryInstrument.isActive() )
  m_totalMemoryInstrument.setValue( (int)totalMemory );
if( m_freeMemoryInstrument.isActive() )
  m_freeMemoryInstrument.setValue( (int)freeMemory );
if( m_memoryInstrument.isActive() )
  m_memoryInstrument.setValue( (int)( totalMemory - freeMemory ) );
origin: org.apache.excalibur.component/excalibur-component

/**
 * Create a new AbstractComponentManagerServlet.
 *
 * @param referenceName A name which does not include any spaces or periods
 *                      that will be used to name the logger category and
 *                      instrumentable which represents this servlet.
 */
public AbstractComponentManagerServlet( String referenceName )
{
  //System.out.println( "AbstractComponentManagerServlet( " + referenceName + " )" );
  m_referenceName = referenceName;
  // Set up Instrumentable like AbstractInstrumentable
  m_registered = false;
  m_instrumentList = new ArrayList();
  m_childList = new ArrayList();
  // Create the instruments
  setInstrumentableName( referenceName );
  addInstrument( m_instrumentRequests = new CounterInstrument( "requests" ) );
  addInstrument( m_instrumentTime = new ValueInstrument( "time" ) );
}
origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

/**
 * Called to increment the number of Permanent Instrument Samples registered.
 */
void incrementPermanentSampleCount()
{
  int count;
  synchronized( m_semaphore )
  {
    count = ++m_permanentSampleCount + m_leasedSampleCount;
  }
  m_samplesInstrument.setValue( count );
}

origin: org.apache.excalibur.component/excalibur-component

if ( m_instrumentTime.isActive() )
  m_instrumentTime.setValue( (int)( System.currentTimeMillis() - start ) );
origin: org.apache.excalibur.component/excalibur-component

/**
 * Create a new AbstractServiceManagerServlet.
 *
 * @param referenceName A name which does not include any spaces or periods
 *                      that will be used to name the logger category and
 *                      instrumentable which represents this servlet.
 */
public AbstractServiceManagerServlet( String referenceName )
{
  //System.out.println( "AbstractServiceManagerServlet( " + referenceName + " )" );
  m_referenceName = referenceName;
  // Set up Instrumentable like AbstractInstrumentable
  m_registered = false;
  m_instrumentList = new ArrayList();
  m_childList = new ArrayList();
  // Create the instruments
  setInstrumentableName( referenceName );
  addInstrument( m_instrumentRequests = new CounterInstrument( "requests" ) );
  addInstrument( m_instrumentTime = new ValueInstrument( "time" ) );
}
origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

/**
 * Called to increment the number of Leased Instrument Samples registered.
 */
void incrementLeasedSampleCount()
{
  int count;
  int leasedCount;
  synchronized( m_semaphore )
  {
    leasedCount = ++m_leasedSampleCount;
    count = m_permanentSampleCount + m_leasedSampleCount;
  }
  m_samplesInstrument.setValue( count );
  m_leasedSamplesInstrument.setValue( leasedCount );
}

origin: org.apache.excalibur.component/excalibur-component

if( m_instrumentTime.isActive() )
  m_instrumentTime.setValue( (int)( System.currentTimeMillis() - start ) );
origin: org.apache.excalibur.components/excalibur-pool-instrumented

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 );
origin: org.apache.excalibur.containerkit/excalibur-instrument-mgr-impl

/**
 * Called to decrement the number of Leased Instrument Samples registered.
 */
void decrementLeasedSampleCount()
{
  int count;
  int leasedCount;
  synchronized( m_semaphore )
  {
    leasedCount = --m_leasedSampleCount;
    count = m_permanentSampleCount + m_leasedSampleCount;
  }
  m_samplesInstrument.setValue( count );
  m_leasedSamplesInstrument.setValue( leasedCount );
}

origin: org.apache.excalibur.component/excalibur-component

/**
 * Creates a new ComponentHandler.
 */
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" ) );
}
origin: org.apache.excalibur.components/excalibur-store

/**
 * Clear the Store of all elements
 */
public synchronized void clear()
{
  Enumeration enumer = m_cache.keys();
  while( enumer.hasMoreElements() )
  {
    Object key = enumer.nextElement();
    if( key == null )
    {
      continue;
    }
    remove( key );
  }
  m_sizeInstrument.setValue( 0 );
}
origin: org.apache.excalibur.component/excalibur-component

m_referencesInstrument.setValue( m_references );
origin: org.apache.excalibur.component/excalibur-component

/**
 * Get an instance of the type of component handled by this handler.
 * <p>
 * Subclasses should not extend this method but rather the doGet method below otherwise
 *  reference counts will not be supported.
 * <p>
 * This method is not final to make the class backwards compatible.
 *
 * @return a <code>Component</code>
 * @exception Exception if an error occurs
 */
public Component get() throws Exception
{
  Component component = doGet();
  synchronized( m_referenceSemaphore )
  {
    m_references++;
  }
  // Notify the instrument manager
  m_getsInstrument.increment();
  m_referencesInstrument.setValue( m_references );
  return component;
}
origin: org.apache.excalibur.components/excalibur-pool-instrumented

/**
 * Create a new poolable instance by by calling the newInstance method
 *  on the pool's ObjectFactory.
 * <p>
 * This is the method to override when you need to enforce creational
 *  policies.
 * <p>
 * This method is only called by threads that have m_semaphore locked.
 */
protected Poolable newPoolable() throws Exception
{
  Object obj = m_factory.newInstance();
  // Notify the InstrumentManager
  m_createsInstrument.increment();
  // The size is incremented after this call in case an error is thrown.
  m_sizeInstrument.setValue( getSize() + 1 );
  return (Poolable)obj;
}
origin: org.apache.excalibur.components/excalibur-pool-instrumented

m_sizeInstrument.setValue( size );
m_readySizeInstrument.setValue( readySize );
org.apache.excalibur.instrumentValueInstrument

Javadoc

Objects implementing Instrumentable can create Instruments with integer values using a ValueInstrument. ValueInstruments are perfect for profiling things like system memory, or the size of a pool or cache.

Most used methods

  • setValue
    Sets the current value of the Instrument. This method is optimized to be extremely light weight when
  • <init>
    Creates a new ValueInstrument.
  • isActive
  • getInstrumentProxy

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • getApplicationContext (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now