File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed
Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -1421,21 +1421,34 @@ void RocksDBStore::get_statistics(Formatter *f)
14211421 << dendl;
14221422 return ;
14231423 }
1424-
1424+
14251425 if (cct->_conf ->rocksdb_collect_compaction_stats ) {
1426- std::string stat_str;
1427- bool status = db->GetProperty (" rocksdb.stats" , &stat_str);
1428- if (status) {
1429- f->open_object_section (" rocksdb_statistics" );
1426+ vector<rocksdb::ColumnFamilyHandle*> handles;
1427+ handles.push_back (default_cf);
1428+ for (auto cf : cf_handles) {
1429+ for (auto shard_cf : cf.second .handles ) {
1430+ handles.push_back (shard_cf);
1431+ }
1432+ }
1433+ f->open_object_section (" rocksdb_statistics" );
1434+ for (auto handle : handles) {
1435+ std::string stat_str;
1436+ bool status = db->GetProperty (handle, " rocksdb.stats" , &stat_str);
1437+ if (!status) {
1438+ derr << __func__ << " failed to get rocksdb.stats for the cf: "
1439+ << handle->GetName () << dendl;
1440+ continue ;
1441+ }
14301442 f->dump_string (" rocksdb_compaction_statistics" , " " );
14311443 vector<string> stats;
14321444 split_stats (stat_str, ' \n ' , stats);
14331445 for (auto st :stats) {
14341446 f->dump_string (" " , st);
1435- }
1436- f->close_section ();
1447+ }
14371448 }
1449+ f->close_section ();
14381450 }
1451+
14391452 if (cct->_conf ->rocksdb_collect_extended_stats ) {
14401453 if (dbstats) {
14411454 f->open_object_section (" rocksdb_extended_statistics" );
You can’t perform that action at this time.
0 commit comments