Skip to content

Commit

Permalink
jmx
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Feb 11, 2018
1 parent 1844128 commit 546e916
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 6 deletions.
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ maven-3.2.3+
# 2. Simple usage
## 2.1. PoolBuilder

| **config** | **default value** | **details** |
| **Config** | **Default value** | **Details** |
| ---------- | ------------------ | ------------------------------------------------------------------------------------|
| minimum | 0 | minimum allowed objects in pool |
| maximum | 16 | maximum allowed objects in pool |
Expand All @@ -64,7 +64,7 @@ maven-3.2.3+
| supplier   |         | required callback for creating pool objects          |
| consumer | | optional callback for destroying pool objects |
| validator | | optional callback for validating pool objects |
| validation | PULSE | precondition for `validator`, e.g : `new PoolValidation(PULSE\|ACQUIRE\| RELEASE)` |
| validation | PULSE | precondition for `validator`, e.g : `new PoolValidation(PULSE\|ACQUIRE\|RELEASE)` |


## 2.2. Usage
Expand Down Expand Up @@ -182,7 +182,33 @@ Pool<YourPoolObject> pool = new PoolBuilder<YourPoolObject>()
.build("object pool");
```

# 5. Benchmark
# 5. JMX

MXBean : `cn.nextop.lite.pool:type=PoolConfig`

| **Attribute** | **Modifiable** | **Details** |
|---------------|----------------|-----------------------------------------|
| Maximum | Yes | see [2.1. PoolBuilder](#21-poolbuilder) |
| Minimum | Yes | see [2.1. PoolBuilder](#21-poolbuilder) |
| Tenancy | Yes | see [2.1. PoolBuilder](#21-poolbuilder) |
| Timeout | Yes | see [2.1. PoolBuilder](#21-poolbuilder) |
| Tti | Yes | see [2.1. PoolBuilder](#21-poolbuilder) |
| Ttl | Yes | see [2.1. PoolBuilder](#21-poolbuilder) |
| Verbose | Yes | see [2.1. PoolBuilder](#21-poolbuilder) |
| Maximum | Yes | see [2.1. PoolBuilder](#21-poolbuilder) |
| Maximum | Yes | see [2.1. PoolBuilder](#21-poolbuilder) |

MXBean : `cn.nextop.lite.pool:type=PoolAllocator`

| **Attribute** | **Modifiable** | **Details** |
|---------------|----------------|-------------------------------------------------------------------|
| BusyCount | No | pool's busy object count, equivalent to `TotalCount - IdleCount`. |
| IdleCount | No | pool's idle object count. |
| TotalCount | No | pool's total object count. |
| PendingCount | No | pool's pending request object count. |


# 6. Benchmark

Test env:

Expand Down
33 changes: 30 additions & 3 deletions README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
* [2.2. 使用](#22-使用)
* [3. PoolListener](#3-poollistener)
* [4. 扩展自己的PoolAllocator](#4-扩展自己的poolallocator)
* [5. 基准测试](#5-基准测试)
* [5. JMX](#5-jmx)
* [6. 基准测试](#6-基准测试)


# 1. Lite-pool
Expand Down Expand Up @@ -63,7 +64,7 @@ maven-3.2.3+
| supplier   |         | 创建pool对象的回调方法, 必选项          |
| consumer | | 销毁pool对象的回调方法, 可选项 |
| validator | | 验证pool对象的回调方法, 可选项 |
| validation | PULSE | 验证pool对象的的前置条件, 例如:`new PoolValidation(PULSE\|ACQUIRE\| RELEASE)` |
| validation | PULSE | 验证pool对象的的前置条件, 例如:`new PoolValidation(PULSE\|ACQUIRE\|RELEASE)` |


## 2.2. 使用
Expand Down Expand Up @@ -181,7 +182,33 @@ Pool<YourPoolObject> pool = new PoolBuilder<YourPoolObject>()
.build("object pool");
```

# 5. 基准测试
# 5. JMX

MXBean : `cn.nextop.lite.pool:type=PoolConfig`

| **属性** | **可变更** | **详解** |
|---------------|----------------|-----------------------------------------|
| Maximum || 参照 [2.1. PoolBuilder](#21-poolbuilder) |
| Minimum || 参照 [2.1. PoolBuilder](#21-poolbuilder) |
| Tenancy || 参照 [2.1. PoolBuilder](#21-poolbuilder) |
| Timeout || 参照 [2.1. PoolBuilder](#21-poolbuilder) |
| Tti || 参照 [2.1. PoolBuilder](#21-poolbuilder) |
| Ttl || 参照 [2.1. PoolBuilder](#21-poolbuilder) |
| Verbose || 参照 [2.1. PoolBuilder](#21-poolbuilder) |
| Maximum || 参照 [2.1. PoolBuilder](#21-poolbuilder) |
| Maximum || 参照 [2.1. PoolBuilder](#21-poolbuilder) |

MXBean : `cn.nextop.lite.pool:type=PoolAllocator`

| **属性** | **可变更** | **详解** |
|---------------|----------------|-----------------------------------------------------------|
| BusyCount || pool中处于繁忙状态的对象数量, 等价于 `TotalCount - IdleCount` |
| IdleCount || pool中处于空闲状态的对象数量. |
| TotalCount || pool中总的对象数量. |
| PendingCount || pool中处于等待请求的对象数量. |


# 6. 基准测试

测试环境 :

Expand Down

0 comments on commit 546e916

Please sign in to comment.