@@ -1246,16 +1246,76 @@ class TStatService : public TActorBootstrapped<TStatService> {
12461246 TBase::PassAway ();
12471247 }
12481248
1249- void Handle (NMon::TEvHttpInfo::TPtr& ev) {
1250- auto & request = ev->Get ()->Request ;
1249+ void PrintStatServiceState (TStringStream& str) {
1250+ HTML (str) {
1251+ PRE () {
1252+ str << " ---- StatisticsService ----" << Endl << Endl;
1253+ str << " StatisticsAggregatorId: " << StatisticsAggregatorId << Endl;
1254+ str << " SAPipeClientId: " << SAPipeClientId << Endl;
1255+
1256+ str << " InFlight: " << InFlight.size ();
1257+ {
1258+ ui32 simple{ 0 };
1259+ ui32 countMin{ 0 };
1260+ for (auto it = InFlight.begin (); it != InFlight.end (); ++it) {
1261+ if (it->second .StatType == EStatType::SIMPLE) {
1262+ ++simple;
1263+ } else if (it->second .StatType == EStatType::COUNT_MIN_SKETCH) {
1264+ ++countMin;
1265+ }
1266+ }
1267+ str << " [SIMPLE: " << simple << " , COUNT_MIN_SKETCH: " << countMin << " ]" << Endl;
1268+ }
1269+ str << " NextRequestId: " << NextRequestId << Endl;
12511270
1252- if (!EnableColumnStatistics) {
1253- Send (ev->Sender , new NMon::TEvHttpInfoRes (" Column statistics is disabled" ));
1254- return ;
1271+ str << " LoadQueriesInFlight: " << LoadQueriesInFlight.size () << Endl;
1272+ str << " NextLoadQueryCookie: " << NextLoadQueryCookie << Endl;
1273+
1274+ str << " NeedSchemeShards: " << NeedSchemeShards.size () << Endl;
1275+ str << " Statistics: " << Statistics.size () << Endl;
1276+
1277+ str << " ResolveSAStage: " ;
1278+ if (ResolveSAStage == RSA_INITIAL) {
1279+ str << " RSA_INITIAL" ;
1280+ } else if (ResolveSAStage == RSA_IN_FLIGHT) {
1281+ str << " RSA_IN_FLIGHT" ;
1282+ }
1283+ else {
1284+ str << " RSA_FINISHED" ;
1285+ }
1286+ str << Endl;
1287+
1288+ str << " AggregateKeepAlivePeriod: " << Settings.AggregateKeepAlivePeriod << Endl;
1289+ str << " AggregateKeepAliveTimeout: " << Settings.AggregateKeepAliveTimeout << Endl;
1290+ str << " AggregateKeepAliveAckTimeout: " << Settings.AggregateKeepAliveAckTimeout << Endl;
1291+ str << " StatisticsRequestTimeout: " << Settings.StatisticsRequestTimeout << Endl;
1292+ str << " MaxInFlightTabletRequests: " << Settings.MaxInFlightTabletRequests << Endl;
1293+ str << " FanOutFactor: " << Settings.FanOutFactor << Endl;
1294+
1295+ str << " ---- AggregationStatistics ----" << Endl;
1296+ str << " Round: " << AggregationStatistics.Round << Endl;
1297+ str << " Cookie: " << AggregationStatistics.Cookie << Endl;
1298+ str << " PathId: " << AggregationStatistics.PathId .ToString () << Endl;
1299+ str << " LastAckHeartbeat: " << AggregationStatistics.LastAckHeartbeat << Endl;
1300+ str << " ParentNode: " << AggregationStatistics.ParentNode << Endl;
1301+ str << " PprocessedNodes: " << AggregationStatistics.PprocessedNodes << Endl;
1302+ str << " TotalStatisticsResponse: " << AggregationStatistics.TotalStatisticsResponse << Endl;
1303+ str << " Nodes: " << AggregationStatistics.Nodes .size () << Endl;
1304+ str << " CountMinSketches: " << AggregationStatistics.CountMinSketches .size () << Endl;
1305+ }
12551306 }
1307+ }
1308+
1309+ void Handle (NMon::TEvHttpInfo::TPtr& ev) {
1310+ auto & request = ev->Get ()->Request ;
12561311
12571312 auto method = request.GetMethod ();
12581313 if (method == HTTP_METHOD_POST) {
1314+ if (!EnableColumnStatistics) {
1315+ Send (ev->Sender , new NMon::TEvHttpInfoRes (" Column statistics is disabled" ));
1316+ return ;
1317+ }
1318+
12591319 auto & params = request.GetPostParams ();
12601320 auto itAction = params.find (" action" );
12611321 if (itAction == params.end ()) {
@@ -1276,6 +1336,18 @@ class TStatService : public TActorBootstrapped<TStatService> {
12761336
12771337 } else if (method == HTTP_METHOD_GET) {
12781338 auto & params = request.GetParams ();
1339+ if (params.empty ()) {
1340+ TStringStream str;
1341+ PrintStatServiceState (str);
1342+ Send (ev->Sender , new NMon::TEvHttpInfoRes (str.Str ()));
1343+ return ;
1344+ }
1345+
1346+ if (!EnableColumnStatistics) {
1347+ Send (ev->Sender , new NMon::TEvHttpInfoRes (" Column statistics is disabled" ));
1348+ return ;
1349+ }
1350+
12791351 auto itAction = params.find (" action" );
12801352 if (itAction == params.end ()) {
12811353 Send (ev->Sender , new NMon::TEvHttpInfoRes (" 'action' parameter is required" ));
0 commit comments