zentol 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_r223873851
########## File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBNativeMetricOptions.java ########## @@ -0,0 +1,278 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.contrib.streaming.state; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +/** + * Enable which RocksDB metrics to forward to Flink's metrics reporter. + * All metrics report at the column family level and return unsigned long values. + * + * <p>Properties and doc comments are taken from RocksDB documentation. See + * <a href="https://github.com/facebook/rocksdb/blob/64324e329eb0a9b4e77241a425a1615ff524c7f1/include/rocksdb/db.h#L429"> + * db.h</a> for more information. + */ +public class RocksDBNativeMetricOptions { + + private static final long TEN_SECONDS = 10 * 1000; + + private Set<String> properties; + + private long frequency = TEN_SECONDS; + + public RocksDBNativeMetricOptions() { + this.properties = new HashSet<>(); + } + + /** + * Returns number of immutable memtables that have not yet been flushed. + */ + public void enableNumImmutableMemTable() { + this.properties.add("rocksdb.num-immutable-mem-table"); Review comment: all of this must be configurable via the `flink-conf.yaml` configuration. ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
