获取 Proxool 连接池 连接数量

来源:互联网 发布:hf线剧情 知乎 编辑:程序博客网 时间:2024/04/30 01:17
 

SnapshotIF snapshot = ProxoolFacade.getSnapshot("alias",true);
int curActiveCount= snapshot.getActiveConnectionCount();// 获得活动连接数
int availableCount= snapshot.getAvailableConnectionCount();// 获得可得到的连接数
int maxCount= snapshot.getMaximumConnectionCount();// 获得总连接数

具体参见 org.logicalcobwebs.proxool.admin.SnapshotIF

/**
     * How many connections have been served since the pool started
     * @return servedCount
     */
    long getServedCount();

    /**
     * How many connections have been refused since the pool started
     * @return refusedCount
     */
    long getRefusedCount();

    /**
     * The number of active (busy) connections
     * @return activeConnectionCount
     */
    int getActiveConnectionCount();

    /**
     * The number of available (free) connections
     * @return availableConnectionCount
     */
    int getAvailableConnectionCount();

    /**
     * The number of offline connections. A connection is offline
     * if it is being tested by the house keeper.
     * @return offlineConnectionCount
     */
    int getOfflineConnectionCount();

    /**
     * Get the maximum possible connections (as defined in the
     * {@link org.logicalcobwebs.proxool.ConnectionPoolDefinitionIF definition}.
     * @return maximumConnectionCount
     */
    int getMaximumConnectionCount();

 

 

本文转自:http://hi.baidu.com/duangr/blog/item/2be91dfe47107e3c5c600804.html