| 296 | } |
| 297 | |
| 298 | double RuntimeState::ComputeExchangeScanRatio() const { |
| 299 | int64_t bytes_read = 0; |
| 300 | for (const auto& c : bytes_read_counters_) bytes_read += c->value(); |
| 301 | if (bytes_read == 0) return 0; |
| 302 | int64_t bytes_sent = 0; |
| 303 | for (const auto& c : bytes_sent_counters_) bytes_sent += c->value(); |
| 304 | return (double)bytes_sent / bytes_read; |
| 305 | } |
| 306 | |
| 307 | void RuntimeState::SetMemLimitExceeded(MemTracker* tracker, |
| 308 | int64_t failed_allocation_size, const ErrorMsg* msg) { |