@@ -882,8 +882,6 @@ const std::string InfoCmd::kKeyspaceSection = "keyspace";
882882const std::string InfoCmd::kDataSection = " data" ;
883883const std::string InfoCmd::kRocksDBSection = " rocksdb" ;
884884const std::string InfoCmd::kDebugSection = " debug" ;
885- const std::string InfoCmd::kCommandP99Section = " commandp99" ;
886- const std::string InfoCmd::kSlowCommandSection = " slowcommand" ;
887885const std::string InfoCmd::kCommandStatsSection = " commandstats" ;
888886const std::string InfoCmd::kCacheSection = " cache" ;
889887
@@ -969,10 +967,6 @@ void InfoCmd::DoInitial() {
969967 info_section_ = kInfoDebug ;
970968 } else if (strcasecmp (argv_[1 ].data (), kCommandStatsSection .data ()) == 0 ) {
971969 info_section_ = kInfoCommandStats ;
972- } else if (strcasecmp (argv_[1 ].data (), kCommandP99Section .data ()) == 0 ) {
973- info_section_ = kInfoCommandP99 ;
974- } else if (strcasecmp (argv_[1 ].data (), kSlowCommandSection .data ()) == 0 ) {
975- info_section_ = kInfoSlowCommand ;
976970 } else if (strcasecmp (argv_[1 ].data (), kCacheSection .data ()) == 0 ) {
977971 info_section_ = kInfoCache ;
978972 } else {
@@ -1014,10 +1008,6 @@ void InfoCmd::Do() {
10141008 info.append (" \r\n " );
10151009 InfoCommandStats (info);
10161010 info.append (" \r\n " );
1017- InfoCommandP99 (info);
1018- info.append (" \r\n " );
1019- InfoSlowCommand (info);
1020- info.append (" \r\n " );
10211011 InfoCache (info, db_);
10221012 info.append (" \r\n " );
10231013 InfoCPU (info);
@@ -1061,12 +1051,6 @@ void InfoCmd::Do() {
10611051 case kInfoCommandStats :
10621052 InfoCommandStats (info);
10631053 break ;
1064- case kInfoCommandP99 :
1065- InfoCommandP99 (info);
1066- break ;
1067- case kInfoSlowCommand :
1068- InfoSlowCommand (info);
1069- break ;
10701054 case kInfoCache :
10711055 InfoCache (info, db_);
10721056 break ;
@@ -1497,73 +1481,6 @@ void InfoCmd::InfoDebug(std::string& info) {
14971481 g_pika_server->ServerStatus (&info);
14981482}
14991483
1500- void InfoCmd::InfoCommandP99 (std::string& info) {
1501- std::stringstream tmp_stream;
1502- tmp_stream.precision (2 );
1503- tmp_stream.setf (std::ios::fixed);
1504- tmp_stream << " # Commands P99" << " \r\n " ;
1505- auto histogram_family = g_pika_cmd_table_manager->GetHistograms ();
1506-
1507- for (const auto & metric_family : histogram_family->Collect ()) {
1508- for (const auto & metric : metric_family.metric ) {
1509- std::string command_name;
1510-
1511- for (const auto & label : metric.label ) {
1512- if (label.name == " command" ) {
1513- command_name = label.value ;
1514- break ;
1515- }
1516- }
1517-
1518- double total_count = metric.histogram .sample_count ;
1519-
1520- if (command_name.empty ()) {
1521- tmp_stream << " Command: UNKNOWN\r\n " ;
1522- } else {
1523- tmp_stream << " Command: " << command_name << " \r\n " ;
1524- }
1525-
1526- double tp99_threshold = total_count * 0.99 ;
1527- double tp999_threshold = total_count * 0.999 ;
1528- double tp9999_threshold = total_count * 0.9999 ;
1529- double tp99 = 0 , tp999 = 0 , tp9999 = 0 ;
1530-
1531- for (const auto & bucket : metric.histogram .bucket ) {
1532- if (bucket.cumulative_count >= tp99_threshold && tp99 == 0 ) {
1533- tp99 = bucket.upper_bound ;
1534- }
1535- if (bucket.cumulative_count >= tp999_threshold && tp999 == 0 ) {
1536- tp999 = bucket.upper_bound ;
1537- }
1538- if (bucket.cumulative_count >= tp9999_threshold && tp9999 == 0 ) {
1539- tp9999 = bucket.upper_bound ;
1540- break ;
1541- }
1542- }
1543- tmp_stream << " TP99 ms: " << tp99 << " \r\n " ;
1544- tmp_stream << " TP999 ms: " << tp999 << " \r\n " ;
1545- tmp_stream << " TP9999 ms: " << tp9999 << " \r\n " ;
1546- tmp_stream << " ----------------------\r\n " ;
1547- }
1548- }
1549-
1550- info.append (tmp_stream.str ());
1551- }
1552-
1553- void InfoCmd::InfoSlowCommand (std::string& info) {
1554- std::stringstream tmp_stream;
1555- tmp_stream.precision (2 );
1556- tmp_stream.setf (std::ios::fixed);
1557- auto stats = g_pika_cmd_table_manager->GetSlowCommandCount ();
1558- tmp_stream << " # SlowCommand Count" << " \r\n " ;
1559- for (auto iter : stats) {
1560- if (iter.second .cmd_count != 0 ) {
1561- tmp_stream << iter.first << " :slow_count=" << iter.second .cmd_count << " \r\n " ;
1562- }
1563- }
1564- info.append (tmp_stream.str ());
1565- }
1566-
15671484void InfoCmd::InfoCommandStats (std::string& info) {
15681485 std::stringstream tmp_stream;
15691486 tmp_stream.precision (2 );
0 commit comments