MCPcopy Create free account
hub / github.com/apache/kvrocks / GetRocksDBStatsJson

Method GetRocksDBStatsJson

src/server/server.cc:1573–1591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1571}
1572
1573std::string Server::GetRocksDBStatsJson() const {
1574 jsoncons::json stats_json;
1575
1576 auto stats = storage->GetDB()->GetDBOptions().statistics;
1577 for (const auto &iter : rocksdb::TickersNameMap) {
1578 stats_json[iter.second] = stats->getTickerCount(iter.first);
1579 }
1580
1581 for (const auto &iter : rocksdb::HistogramsNameMap) {
1582 rocksdb::HistogramData hist_data;
1583 stats->histogramData(iter.first, &hist_data);
1584 /* P50 P95 P99 P100 COUNT SUM */
1585 stats_json[iter.second] =
1586 jsoncons::json(jsoncons::json_array_arg, {hist_data.median, hist_data.percentile95, hist_data.percentile99,
1587 hist_data.max, hist_data.count, hist_data.sum});
1588 }
1589
1590 return stats_json.to_string();
1591}
1592
1593// This function is called by replication thread when finished fetching all files from its master.
1594// Before restoring the db from backup or checkpoint, we should

Callers 1

ExecuteMethod · 0.80

Calls 1

GetDBMethod · 0.80

Tested by

no test coverage detected