| 1158 | return false; |
| 1159 | } |
| 1160 | TString GetDebugInfoLocked() { |
| 1161 | TString res = KeepRunning ? "State: running\n" : "State: stopping\n"; |
| 1162 | auto promise = NThreading::NewPromise<TString>(); |
| 1163 | Host->GetDebugInfo([promise](const TString& str) mutable { |
| 1164 | promise.SetValue(str); |
| 1165 | }); |
| 1166 | auto future = promise.GetFuture(); |
| 1167 | future.Wait(); |
| 1168 | res += future.GetValue(); |
| 1169 | |
| 1170 | char buf[1000]; |
| 1171 | TRequesterUserQueueSizes* qs = QueueSizes.Get(); |
| 1172 | snprintf(buf, sizeof(buf), "\nRequest queue %d (%d bytes)\n", (int)AtomicGet(qs->ReqCount), (int)AtomicGet(qs->ReqQueueSize)); |
| 1173 | res += buf; |
| 1174 | snprintf(buf, sizeof(buf), "Response queue %d (%d bytes)\n", (int)AtomicGet(qs->RespCount), (int)AtomicGet(qs->RespQueueSize)); |
| 1175 | res += buf; |
| 1176 | |
| 1177 | const char* outReqStateNames[] = { |
| 1178 | "S_SENDING", |
| 1179 | "S_WAITING", |
| 1180 | "S_WAITING_PING_SENDING", |
| 1181 | "S_WAITING_PING_SENT", |
| 1182 | "S_CANCEL_AT_SENDING"}; |
| 1183 | const char* inReqStateNames[] = { |
| 1184 | "S_WAITING", |
| 1185 | "S_RESPONSE_SENDING", |
| 1186 | "S_CANCELED"}; |
| 1187 | res += "\nOut requests:\n"; |
| 1188 | for (TOutRequestHash::const_iterator i = OutRequests.begin(); i != OutRequests.end(); ++i) { |
| 1189 | const TGUID& gg = i->first; |
| 1190 | const TOutRequestState& s = i->second; |
| 1191 | bool isSync = SyncRequests.find(gg) != SyncRequests.end(); |
| 1192 | snprintf(buf, sizeof(buf), "%s\t%s %s TimePassed: %g %s\n", |
| 1193 | GetAddressAsString(s.Connection->GetAddress()).c_str(), GetGuidAsString(gg).c_str(), outReqStateNames[s.State], |
| 1194 | s.TimePassed * 1000, |
| 1195 | isSync ? "isSync" : ""); |
| 1196 | res += buf; |
| 1197 | } |
| 1198 | res += "\nIn requests:\n"; |
| 1199 | for (TInRequestHash::const_iterator i = InRequests.begin(); i != InRequests.end(); ++i) { |
| 1200 | const TGUID& gg = i->first; |
| 1201 | const TInRequestState& s = i->second; |
| 1202 | snprintf(buf, sizeof(buf), "%s\t%s %s\n", |
| 1203 | GetAddressAsString(s.Connection->GetAddress()).c_str(), GetGuidAsString(gg).c_str(), inReqStateNames[s.State]); |
| 1204 | res += buf; |
| 1205 | } |
| 1206 | return res; |
| 1207 | } |
| 1208 | TString GetDebugInfo() override { |
| 1209 | TIntrusivePtr<TStatsRequest> req = new TStatsRequest(TStatsRequest::DEBUG_INFO); |
| 1210 | ExecStatsRequest(req); |
nothing calls this directly
no test coverage detected