You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "szaszm (via GitHub)" <gi...@apache.org> on 2023/06/15 16:00:19 UTC

[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1540: MINIFICPP-2082 Move RocksDB stats to RepositoryMetrics

szaszm commented on code in PR #1540:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1540#discussion_r1159265202


##########
extensions/rocksdb-repos/DatabaseContentRepository.cpp:
##########
@@ -286,6 +286,32 @@ uint64_t DatabaseContentRepository::getRepositoryEntryCount() const {
             })).value_or(0);
 }
 
+std::optional<RepositoryMetricsSource::RocksDbStats> DatabaseContentRepository::getRocksDbStats() const {
+  RocksDbStats stats;
+  auto opendb = db_->open();
+  if (!opendb) {
+    return stats;
+  }
+
+  std::string table_readers;
+  opendb->GetProperty("rocksdb.estimate-table-readers-mem", &table_readers);
+  try {
+    stats.table_readers_size = std::stoull(table_readers);
+  } catch (const std::exception&) {
+    logger_->log_error("Could not retrieve valid 'rocksdb.estimate-table-readers-mem' property value from rocksdb content repository!");

Review Comment:
   A warning may be enough, since this doesn't prevent normal operation of the agent



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org