Top Description Methods
stormpot

public Interface ManagedPool

Known Direct Implementers
stormpot.BlazePool
Annotations
@MXBean
Imports
javax.management.MXBean

This is the JMX management interface for Stormpot object pools. Using this interface, pools can be exposed to external management as an MXBean. Since its an MXBean, and not just an MBean, it imposes no special requirements on 3rd party JMX integrators. Once you have created your pool, it is easy to expose it through the platform MBeanServer, or any MBeanServer you like: [source,java] ---- include::../src/test/java/examples/Examples.java[tag=managedPoolExample] ---- Using the platform MBeanServer will make the pool visible to tools like JConsole and VisualVM.
Since
2.3

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

The number of Poolable objects ever created by this pool.
getAllocationCount
()

Return the number of objects the pool has allocated since it was created.

public double

Returns:

The approximate latency for failed allocations in milliseconds, for the given percentile, or Double.NaN if no stormpot.MetricsRecorder has been configured for the pool.
getAllocationFailureLatencyPercentile
(double
The percentile to get, as a decimal, e.g. a number between 0.0 and 1.0.
percentile
)

Get the approximate latency value, in milliseconds, for failed allocation latencies within the given percentile/quantile of what has been recorded so far.

public double

Returns:

The approximate latency for allocations in milliseconds, for the given percentile, or Double.NaN if no stormpot.MetricsRecorder has been configured for the pool.
getAllocationLatencyPercentile
(double
The percentile to get, as a decimal, e.g. a number between 0.0 and 1.0.
percentile
)

Get the approximate Poolable object allocation latency value, in milliseconds, of the given percentile/quantile of the values recorded so far.

public double

Returns:

The approximate latency for deallocations, regardless of whether the throw exceptions or not, in milliseconds for the given percentile, or Double.NaN if no stormpot.MetricsRecorder has been configured for the pool.
getDeallocationLatencyPercentile
(double
The percentile to get, as a decimal, e.g. a number between 0.0 and 1.0.
percentile
)

Get the approximate latency value, in milliseconds, for deallocation latencies within the given percentile/quantile of what has been recorded so far.

public long

Returns:

The number of allocations that have failed for one reason or another.
getFailedAllocationCount
()

Return the number of allocations that has failed, either because the allocator threw an exception or because it returned null, since the pool was created.

public long

Returns:

The number of objects leaked from the users of this pool, since the pool was created, or -1 if the pool does not implement precise leak detection.
getLeakedObjectsCount
()

If the pool is capable of precise object leak detection, this method will return the number of object leaks that have been detected, and prevented, since the pool was created.

public double

Returns:

The approximate object lifetime in milliseconds, for the given percentile, or Double.NaN if no stormpot.MetricsRecorder has been configured for the pool.
getObjectLifetimePercentile
(double
The percentile to get, as a decimal, e.g. a number between 0.0 and 1.0.
percentile
)

Get the approximate object lifetime, in milliseconds, for the given percentile/quantile.

public double

Returns:

The approximate latency for failed reallocations in milliseconds, for the given percentile, or Double.NaN if no stormpot.MetricsRecorder has been configured for the pool.
getReallocationFailureLatencyPercentile
(double
The percentile to get, as a decimal, e.g. a number between 0.0 and 1.0.
percentile
)

Get the approximate latency value, in milliseconds, for failed reallocation latencies within the given percentile/quantile of what has been recorded so far.

public double

Returns:

The approximate latency for reallocations in milliseconds, for the given percentile, or Double.NaN if no stormpot.MetricsRecorder has been configured for the pool.
getReallocationLatencyPercentile
(double
The percentile to get, as a decimal, e.g. a number between 0.0 and 1.0.
percentile
)

Get the approximate latency value, in milliseconds, for reallocation latencies within the given percentile/quantile of what has been recorded so far.

public int

Returns:

The current target size.
getTargetSize
()

Get the current target size of the pool.

public boolean

Returns:

'true' if Pool#shutdown() has been called on this pool.
isShutDown
()

Returns 'true' if the shut down process has been started on this pool, 'false' otherwise.

public void
setTargetSize(int
The new target size.
size
)

Set a new target size of the pool.

Method Detail

getAllocationCountback to summary
public long getAllocationCount()

Return the number of objects the pool has allocated since it was created.

Returns:long

The number of Poolable objects ever created by this pool.

getAllocationFailureLatencyPercentileback to summary
public double getAllocationFailureLatencyPercentile(double percentile)

Get the approximate latency value, in milliseconds, for failed allocation latencies within the given percentile/quantile of what has been recorded so far.

Parameters
percentile:double

The percentile to get, as a decimal, e.g. a number between 0.0 and 1.0.

Returns:double

The approximate latency for failed allocations in milliseconds, for the given percentile, or Double.NaN if no stormpot.MetricsRecorder has been configured for the pool.

See Also
stormpot.MetricsRecorder#getAllocationFailureLatencyPercentile(double)
getAllocationLatencyPercentileback to summary
public double getAllocationLatencyPercentile(double percentile)

Get the approximate Poolable object allocation latency value, in milliseconds, of the given percentile/quantile of the values recorded so far.

Parameters
percentile:double

The percentile to get, as a decimal, e.g. a number between 0.0 and 1.0.

Returns:double

The approximate latency for allocations in milliseconds, for the given percentile, or Double.NaN if no stormpot.MetricsRecorder has been configured for the pool.

See Also
stormpot.MetricsRecorder#getAllocationLatencyPercentile(double)
getDeallocationLatencyPercentileback to summary
public double getDeallocationLatencyPercentile(double percentile)

Get the approximate latency value, in milliseconds, for deallocation latencies within the given percentile/quantile of what has been recorded so far.

Parameters
percentile:double

The percentile to get, as a decimal, e.g. a number between 0.0 and 1.0.

Returns:double

The approximate latency for deallocations, regardless of whether the throw exceptions or not, in milliseconds for the given percentile, or Double.NaN if no stormpot.MetricsRecorder has been configured for the pool.

See Also
stormpot.MetricsRecorder#getDeallocationLatencyPercentile(double)
getFailedAllocationCountback to summary
public long getFailedAllocationCount()

Return the number of allocations that has failed, either because the allocator threw an exception or because it returned null, since the pool was created.

Returns:long

The number of allocations that have failed for one reason or another.

getLeakedObjectsCountback to summary
public long getLeakedObjectsCount()

If the pool is capable of precise object leak detection, this method will return the number of object leaks that have been detected, and prevented, since the pool was created. If the pool does not support precise object leak detection, then this method returns -1. There are two kinds of leaks: One where the application forgets to release an object back to the pool, but keeps a strong reference to the object, and another where the application not only forgets to release the object, but also looses the reference to the object, making it eligible for garbage collection. The precise leak detector will only count leaks of the latter kind, where the leaked object has been garbage collected.

Returns:long

The number of objects leaked from the users of this pool, since the pool was created, or -1 if the pool does not implement precise leak detection.

getObjectLifetimePercentileback to summary
public double getObjectLifetimePercentile(double percentile)

Get the approximate object lifetime, in milliseconds, for the given percentile/quantile.

Parameters
percentile:double

The percentile to get, as a decimal, e.g. a number between 0.0 and 1.0.

Returns:double

The approximate object lifetime in milliseconds, for the given percentile, or Double.NaN if no stormpot.MetricsRecorder has been configured for the pool.

See Also
stormpot.MetricsRecorder#getObjectLifetimePercentile(double)
getReallocationFailureLatencyPercentileback to summary
public double getReallocationFailureLatencyPercentile(double percentile)

Get the approximate latency value, in milliseconds, for failed reallocation latencies within the given percentile/quantile of what has been recorded so far.

Parameters
percentile:double

The percentile to get, as a decimal, e.g. a number between 0.0 and 1.0.

Returns:double

The approximate latency for failed reallocations in milliseconds, for the given percentile, or Double.NaN if no stormpot.MetricsRecorder has been configured for the pool.

See Also
stormpot.MetricsRecorder#getReallocationFailurePercentile(double)
getReallocationLatencyPercentileback to summary
public double getReallocationLatencyPercentile(double percentile)

Get the approximate latency value, in milliseconds, for reallocation latencies within the given percentile/quantile of what has been recorded so far.

Parameters
percentile:double

The percentile to get, as a decimal, e.g. a number between 0.0 and 1.0.

Returns:double

The approximate latency for reallocations in milliseconds, for the given percentile, or Double.NaN if no stormpot.MetricsRecorder has been configured for the pool.

See Also
stormpot.MetricsRecorder#getReallocationLatencyPercentile(double)
getTargetSizeback to summary
public int getTargetSize()

Get the current target size of the pool.

Returns:int

The current target size.

See Also
Pool#getTargetSize()
isShutDownback to summary
public boolean isShutDown()

Returns 'true' if the shut down process has been started on this pool, 'false' otherwise. This method does not reveal whether or not the shut down process has completed.

Returns:boolean

'true' if Pool#shutdown() has been called on this pool.

setTargetSizeback to summary
public void setTargetSize(int size)

Set a new target size of the pool.

Parameters
size:int

The new target size.

See Also
Pool#setTargetSize(int)