Package org.ldaptive.pool
Class PooledConnectionStatistics
- java.lang.Object
 - 
- org.ldaptive.pool.PooledConnectionStatistics
 
 
- 
public class PooledConnectionStatistics extends Object
Statistics associated with a connection's activity in the pool. Exposes the timestamps when this connection entered both the available pool and the active pool. A size of 512 uses approximately 50 kilobytes of memory per connection. 
- 
- 
Field Summary
Fields Modifier and Type Field Description private Deque<Instant>activeStatsActive stats.private Deque<Instant>availableStatsAvailable stats.private intsizeNumber of available and active timestamps to store. 
- 
Constructor Summary
Constructors Constructor Description PooledConnectionStatistics(int i)Creates a new pooled connection statistics. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActiveStat()Inserts the current timestamp into the active statistics.(package private) voidaddActiveStat(Instant instant)Inserts the supplied timestamp into the active statistics.voidaddAvailableStat()Inserts the current timestamp into the available statistics.(package private) voidaddAvailableStat(Instant instant)Inserts the supplied timestamp into the available statistics.Deque<Instant>getActiveStats()Returns all the active timestamp statistics.Deque<Instant>getAvailableStats()Returns all the available timestamp statistics.InstantgetLastActiveStat()Returns the last timestamp at which this connection was made active.InstantgetLastAvailableStat()Returns the last timestamp at which this connection was made available.StringtoString() 
 - 
 
- 
- 
Method Detail
- 
getAvailableStats
public Deque<Instant> getAvailableStats()
Returns all the available timestamp statistics.- Returns:
 - available timestamp statistics
 
 
- 
getLastAvailableStat
public Instant getLastAvailableStat()
Returns the last timestamp at which this connection was made available.- Returns:
 - millisecond timestamp
 
 
- 
addAvailableStat
public void addAvailableStat()
Inserts the current timestamp into the available statistics. 
- 
addAvailableStat
void addAvailableStat(Instant instant)
Inserts the supplied timestamp into the available statistics. This method is intended for testing.- Parameters:
 instant- to add
 
- 
getActiveStats
public Deque<Instant> getActiveStats()
Returns all the active timestamp statistics.- Returns:
 - active timestamp statistics
 
 
- 
getLastActiveStat
public Instant getLastActiveStat()
Returns the last timestamp at which this connection was made active.- Returns:
 - millisecond timestamp
 
 
- 
addActiveStat
public void addActiveStat()
Inserts the current timestamp into the active statistics. 
- 
addActiveStat
void addActiveStat(Instant instant)
Inserts the supplied timestamp into the active statistics. This method is intended for testing.- Parameters:
 instant- to add
 
 - 
 
 -