Skip to content

Commit d110ddf

Browse files
committed
Update README.md
1 parent dde297d commit d110ddf

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

README.ja.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,27 @@ await looperPool.RegisterActionAsync((in LogicLooperActionContext ctx) =>
112112
### Microsoft.Extensions.Hosting との統合
113113
[samples/LoopHostingApp](samples/LoopHostingApp) をご覧ください。`IHostedService` と組み合わせることでサーバーのライフサイクルなどを考慮した実装を行えます。
114114

115+
### メトリクス
116+
117+
LogicLooper は Metric API を使用してメトリクスを提供します。これにより LogicLooper や登録されているアクションの数、ループ当たりの実行時間といったものを取得できます。
118+
119+
メトリクスの取得を有効化するには LogicLooper.Diagnostics パッケージをインストールして `AddLogicLooperMetrics` を呼び出します。
120+
121+
```csharp
122+
services.AddLogicLooperMetrics();
123+
```
124+
125+
|Instrumentation|Unit|Description|
126+
|---|---|---|
127+
|LogicLooper.shared_pool.loopers|`{looper}`|LogicLooperPool.Shared で稼働している LogicLooper インスタンスの数|
128+
|LogicLooper.shared_pool.running_actions|`{action}`|LogicLooperPool.Shared で稼働している LogicLooper に登録されているアクションの数|
129+
|LogicLooper.running_loopers|`{looper}`|プロセスで稼働している LogicLooper インスタンスの数|
130+
|LogicLooper.running_actions|`{action}`|プロセスで稼働している LogicLooper に登録されているアクションの数|
131+
|LogicLooper.processing_duration_min|`ms`|プロセスで稼働しているループの1ループの実行時間 (最小)|
132+
|LogicLooper.processing_duration_max|`ms`|プロセスで稼働しているループの1ループの実行時間 (最大)|
133+
|LogicLooper.processing_duration_avg|`ms`|プロセスで稼働しているループの1ループの実行時間 (平均)|
134+
135+
115136
## 上級編
116137
### ユニットテスト / フレーム単位実行
117138
LogicLooper と共にユニットテストを記述する場合やフレームを手動で更新したいような場合には `ManualLogicLooper` / `ManualLogicLooperPool` を利用できます。

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,27 @@ await looperPool.RegisterActionAsync((in LogicLooperActionContext ctx) =>
116116
### Integrate with Microsoft.Extensions.Hosting
117117
See [samples/LoopHostingApp](samples/LoopHostingApp).
118118

119+
### Metrics
120+
121+
LogicLooper provides metrics using the Metric API. This allows you to obtain the number of LogicLoopers and registered actions, as well as the execution time per loop.
122+
123+
To enable metrics collection, install the `LogicLooper.Diagnostics` package and call `AddLogicLooperMetrics`.
124+
125+
```csharp
126+
services.AddLogicLooperMetrics();
127+
```
128+
129+
|Instrumentation|Unit|Description|
130+
|---|---|---|
131+
|LogicLooper.shared_pool.loopers|`{looper}`|Number of LogicLooper instances running in LogicLooperPool.Shared|
132+
|LogicLooper.shared_pool.running_actions|`{action}`|Number of actions registered in LogicLooperPool.Shared that are running in LogicLooper|
133+
|LogicLooper.running_loopers|`{looper}`|Number of LogicLooper instances running in the process|
134+
|LogicLooper.running_actions|`{action}`|Number of actions registered in LogicLooper that are running in the process|
135+
|LogicLooper.processing_duration_min|`ms`|Minimum execution time of one loop in the process for LogicLooper|
136+
|LogicLooper.processing_duration_max|`ms`|Maximum execution time of one loop in the process for LogicLooper|
137+
|LogicLooper.processing_duration_avg|`ms`|Average execution time of one loop in the process for LogicLooper|
138+
139+
119140
## Advanced
120141
### Unit tests / Frame-by-Frame execution
121142
If you want to write unit tests with LogicLooper or update frames manually, you can use `ManualLogicLooper` / `ManualLogicLooperPool`.

0 commit comments

Comments
 (0)