rkhachatryan commented on a change in pull request #16177:
URL: https://github.com/apache/flink/pull/16177#discussion_r658737596



##########
File path: docs/content.zh/docs/dev/datastream/fault-tolerance/state.md
##########
@@ -561,6 +561,17 @@ val counts: DataStream[(String, Int)] = stream
     })
 ```
 
+### 跟踪 keyed state 的访问延迟
+
+Flink also allows to track the keyed state access latency for all 
state-backends. This feature is disabled by default.
+To enable this feature you must set the 
`state.backend.latency-track.keyed-state-enabled` as true in the [Flink 
configuration]({{< ref "docs/deployment/config" 
>}}#state-backends-latency-tracking-options).
+
+Once tracking keyed state access latency is enabled, Flink will sample the 
state access latency every `N` access, in which `N` is defined by 
`state.backend.latency-track.sample-interval`.
+This configuration has the default value as 128, and a smaller value will get 
more accurate result but higher performance impact as sampled more frequently.
+
+As the type of this latency metrics is histogram, 
`state.backend.latency-track.history-size` will control the maximum number of 
recorded values in history, which has the default value as 128.
+A larger value of this configuration will occupy more memory footprint, but 
getting a more accurate result.

Review comment:
       1. I'd rather place this text under `Operations` (which currently refers 
here) because this page is more about development with Flink rather than 
running the app in production.
   
   2. Should we also mention that this applies to standard Flink backends 
(RocksDB and Heap) and not custom backends - unless they extend 
`AbstractStateBackend`?
   
   3. Some minor suggestions:
   ```suggestion
   Flink also allows to track the keyed state access latency for all 
state-backends. This feature is disabled by default.
   To enable this feature you must set the 
`state.backend.latency-track.keyed-state-enabled` to true in the [Flink 
configuration]({{< ref "docs/deployment/config" 
>}}#state-backends-latency-tracking-options).
   
   Once tracking keyed state access latency is enabled, Flink will sample the 
state access latency every `N` access, in which `N` is defined by 
`state.backend.latency-track.sample-interval`.
   This configuration has the default value of 128, and a smaller value will 
get more accurate result but higher performance impact as sampled more 
frequently.
   
   As the type of this latency metrics is histogram, 
`state.backend.latency-track.history-size` will control the maximum number of 
recorded values in history, which has the default value of 128.
   A larger value of this configuration will requrie more memory, but will 
provide a more accurate result.
   ```
   
   **ditto English version**




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to