Improved toString() for ConnectionPool implementations.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2019-11-19 10:43:09 +01:00
parent cef80aca2e
commit e89e8ae16e
4 changed files with 17 additions and 3 deletions

View File

@ -67,8 +67,19 @@ public abstract class AbstractConnectionPool implements ConnectionPool, Dumpable
return connections.getLo();
}
/**
* @return the number of pending connections
* @deprecated use {@link #getPendingConnectionCount()} instead
*/
@ManagedAttribute(value = "The number of pending connections", readonly = true)
@Deprecated
public int getPendingCount()
{
return getPendingConnectionCount();
}
@ManagedAttribute(value = "The number of pending connections", readonly = true)
public int getPendingConnectionCount()
{
return connections.getHi();
}

View File

@ -309,9 +309,10 @@ public class DuplexConnectionPool extends AbstractConnectionPool implements Swee
unlock();
}
return String.format("%s@%x[c=%d/%d,a=%d,i=%d]",
return String.format("%s@%x[c=%d/%d/%d,a=%d,i=%d]",
getClass().getSimpleName(),
hashCode(),
getPendingConnectionCount(),
getConnectionCount(),
getMaxConnectionCount(),
activeSize,

View File

@ -382,9 +382,10 @@ public class MultiplexConnectionPool extends AbstractConnectionPool implements C
{
unlock();
}
return String.format("%s@%x[c=%d/%d,b=%d,m=%d,i=%d]",
return String.format("%s@%x[c=%d/%d/%d,b=%d,m=%d,i=%d]",
getClass().getSimpleName(),
hashCode(),
getPendingConnectionCount(),
getConnectionCount(),
getMaxConnectionCount(),
busySize,

View File

@ -214,9 +214,10 @@ public class RoundRobinConnectionPool extends AbstractConnectionPool implements
}
}
}
return String.format("%s@%x[c=%d/%d,a=%d]",
return String.format("%s@%x[c=%d/%d/%d,a=%d]",
getClass().getSimpleName(),
hashCode(),
getPendingConnectionCount(),
present,
getMaxConnectionCount(),
active