| 1948 | } |
| 1949 | |
| 1950 | void Coordinator::ExecQueryRpcStats::ReportRpcSizeWithWarning(int64_t size, |
| 1951 | string&& warning_message) { |
| 1952 | ReportRpcSize(size); |
| 1953 | rpcs_above_warning_threshold_++; |
| 1954 | if (largest_rpc_warnings_.size() >= MAX_EXEC_RPC_WARNINGS) { |
| 1955 | // Compare to the smallest element and replace if bigger |
| 1956 | auto smallest = largest_rpc_warnings_.begin(); |
| 1957 | if (smallest->first > size) return; |
| 1958 | largest_rpc_warnings_.erase(smallest); |
| 1959 | } |
| 1960 | largest_rpc_warnings_.emplace(size, warning_message); |
| 1961 | } |
| 1962 | |
| 1963 | void Coordinator::ExecQueryRpcStats::PrintWarnings() { |
| 1964 | if (rpcs_above_warning_threshold_ == 0) return; |