| 231 | } |
| 232 | |
| 233 | void ProxyRunningRequest::finish(bool is_success) { |
| 234 | CHECK(tokens_used_); |
| 235 | LOG(INFO) << "proxy request " << id_.to_hex() << ": completed: success=" << (is_success ? "YES" : "NO") |
| 236 | << " time=" << run_time() << " payload_parts=" << payload_parts_ << " payload_bytes=" << payload_bytes_ |
| 237 | << " tokens_used=" << tokens_used_->prompt_tokens_used_ << "+" << tokens_used_->cached_tokens_used_ << "+" |
| 238 | << tokens_used_->completion_tokens_used_ << "+" << tokens_used_->reasoning_tokens_used_ << "=" |
| 239 | << tokens_used_->total_tokens_used_; |
| 240 | if (is_success) { |
| 241 | stats()->requests_success++; |
| 242 | } else { |
| 243 | stats()->requests_failed++; |
| 244 | } |
| 245 | |
| 246 | auto work_time = run_time(); |
| 247 | stats_->total_requests_time += work_time; |
| 248 | stats_->total_worker_requests_time += worker_run_time_; |
| 249 | |
| 250 | td::actor::send_closure(runner_, &ProxyRunner::finish_request, id_, client_request_id_, client_, |
| 251 | client_connection_id_, worker_->info, worker_, std::move(tokens_used_), reserved_tokens_, |
| 252 | is_success, work_time, worker_run_time_); |
| 253 | stop(); |
| 254 | } |
| 255 | |
| 256 | std::string ProxyRunningRequest::generate_proxy_debug_inner() { |
| 257 | nlohmann::json v; |
nothing calls this directly
no outgoing calls
no test coverage detected