@@ -186,6 +186,58 @@ Metrics::Metrics(std::string const &listen_addr,
186
186
number_of_pending_mst_transactions.Set (std::get<1 >(mstmetr));
187
187
});
188
188
189
+ // //////////////////////////////////////////////////////////
190
+
191
+ auto ¶m_block_cache_cap = BuildGauge ()
192
+ .Name (" rdb_block_cache_capacity" )
193
+ .Help (" RocksDB block cache capacity" )
194
+ .Register (*registry_)
195
+ .Add ({});
196
+
197
+ auto ¶m_block_cache_usage = BuildGauge ()
198
+ .Name (" rdb_block_cache_usage" )
199
+ .Help (" RocksDB block cache usage" )
200
+ .Register (*registry_)
201
+ .Add ({});
202
+
203
+ auto ¶m_all_mem_tables_sz = BuildGauge ()
204
+ .Name (" rdb_all_mem_tables_sz" )
205
+ .Help (" RocksDB all mem tables size" )
206
+ .Register (*registry_)
207
+ .Add ({});
208
+
209
+ auto ¶m_num_snapshots = BuildGauge ()
210
+ .Name (" rdb_num_snapshots" )
211
+ .Help (" RocksDB number of snapshots" )
212
+ .Register (*registry_)
213
+ .Add ({});
214
+
215
+ auto ¶m_sst_files_size = BuildGauge ()
216
+ .Name (" rdb_sst_files_size" )
217
+ .Help (" RocksDB SST files size" )
218
+ .Register (*registry_)
219
+ .Add ({});
220
+
221
+ rdb_subscriber_ =
222
+ SubscriberCreator<bool , iroha::RocksDbStatus>::template create<
223
+ EventTypes::kOnRdbStats >(
224
+ SubscriptionEngineHandlers::kMetrics ,
225
+ [&](auto &, iroha::RocksDbStatus status) {
226
+ if (status.block_cache_capacity )
227
+ param_block_cache_cap.Set (*status.block_cache_capacity );
228
+
229
+ if (status.block_cache_usage )
230
+ param_block_cache_usage.Set (*status.block_cache_usage );
231
+
232
+ if (status.all_mem_tables_sz )
233
+ param_all_mem_tables_sz.Set (*status.all_mem_tables_sz );
234
+
235
+ if (status.num_snapshots )
236
+ param_num_snapshots.Set (*status.num_snapshots );
237
+
238
+ if (status.sst_files_size )
239
+ param_sst_files_size.Set (*status.sst_files_size );
240
+ });
189
241
// /////////////////////////////
190
242
191
243
auto calc_uptime_ms = [uptime_start_timepoint_ (uptime_start_timepoint_)] {
0 commit comments