[ 
https://issues.apache.org/jira/browse/FLINK-10423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16648152#comment-16648152
 ] 

ASF GitHub Bot commented on FLINK-10423:
----------------------------------------

StefanRRichter commented on a change in pull request #6814: 
[FLINK-10423][rocksdb][metrics] rocksdb native metrics monitor
URL: https://github.com/apache/flink/pull/6814#discussion_r224856170
 
 

 ##########
 File path: 
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackend.java
 ##########
 @@ -606,6 +627,17 @@ private RocksDB openDB(
                Preconditions.checkState(1 + 
stateColumnFamilyDescriptors.size() == stateColumnFamilyHandles.size(),
                        "Not all requested column family handles have been 
created");
 
+               if (this.metricOptions.isEnabled()) {
+                       this.nativeMetricMonitor = new 
RocksDBNativeMetricMonitor(
+                               dbRef,
+                               rocksDBResourceGuard,
+                               metricOptions,
+                               operatorMetricGroup
+                       );
+
+                       
this.cancelStreamRegistry.registerCloseable(nativeMetricMonitor);
 
 Review comment:
   It is not an issue in the sense of a bug, but it is much more explicit. 
`CloseableRegistry` is typically used to coordinate closing of resources across 
multiple threads and I would not use it if we move operate in just one thread.
   
   I think you need to close metrics as first thing in dispose() or else it 
will block. As a rule of thump, all closing in `dispose()`should happen in the 
reverse order of creation.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Forward RocksDB native metrics to Flink metrics reporter 
> ---------------------------------------------------------
>
>                 Key: FLINK-10423
>                 URL: https://issues.apache.org/jira/browse/FLINK-10423
>             Project: Flink
>          Issue Type: New Feature
>          Components: Metrics, State Backends, Checkpointing
>            Reporter: Seth Wiesman
>            Assignee: Seth Wiesman
>            Priority: Major
>              Labels: pull-request-available
>
> RocksDB contains a number of metrics at the column family level about current 
> memory usage, open memtables,  etc that would be useful to users wishing 
> greater insight what rocksdb is doing. This work is inspired heavily by the 
> comments on this rocksdb issue thread 
> (https://github.com/facebook/rocksdb/issues/3216#issuecomment-348779233)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to