2017-12-19 13 views
0

私は今、https://github.com/spring-projects/spring-integration-samples/tree/master/basic/tcp-client-server春の統合TCPパフォーマンスモニタ

この良いソースの例の監視情報を知りたいと思っています。

たとえば、 私は約 について知りたいですかいくつかのクライアントが接続されていますか? いくつのスレッドが使用されていますか?

私の質問について再生できる人はいますか?

答えて

0

あなたはAbstractConnectionFactoryでこれを使用することができます。

/** 
* Returns a list of (currently) open {@link TcpConnection} connection ids; allows, 
* for example, broadcast operations to all open connections. 
* @return the list of connection ids. 
*/ 
public List<String> getOpenConnectionIds() { 
    return Collections.unmodifiableList(this.removeClosedConnectionsAndReturnOpenConnectionIds()); 
} 

スレッドはあなたが経由して外部にThreadPoolTaskExecutor設定され、そのAbstractConnectionFactoryに注入から取得することができます統計:

/** 
* @param taskExecutor the taskExecutor to set 
*/ 
public void setTaskExecutor(Executor taskExecutor) { 
    this.taskExecutor = taskExecutor; 
}