| 857 | } |
| 858 | |
| 859 | void AdmissionController::PoolStats::AdmitQueryAndMemory( |
| 860 | const ScheduleState& state, bool is_trivial, PerUserTracking& per_user_tracking) { |
| 861 | int64_t cluster_mem_admitted = state.GetClusterMemoryToAdmit(); |
| 862 | DCHECK_GT(cluster_mem_admitted, 0); |
| 863 | local_mem_admitted_ += cluster_mem_admitted; |
| 864 | metrics_.local_mem_admitted->Increment(cluster_mem_admitted); |
| 865 | |
| 866 | agg_num_running_ += 1; |
| 867 | metrics_.agg_num_running->Increment(1L); |
| 868 | |
| 869 | local_stats_.num_admitted_running += 1; |
| 870 | metrics_.local_num_admitted_running->Increment(1L); |
| 871 | |
| 872 | metrics_.total_admitted->Increment(1L); |
| 873 | if (is_trivial) ++local_trivial_running_; |
| 874 | |
| 875 | if (per_user_tracking.track_per_user && !per_user_tracking.was_queued) { |
| 876 | // If the query was not previously queued then track the user counts. |
| 877 | IncrementPerUser(per_user_tracking.user); |
| 878 | } |
| 879 | } |
| 880 | |
| 881 | void AdmissionController::PoolStats::ReleaseQuery( |
| 882 | int64_t peak_mem_consumption, bool is_trivial, const std::string& user) { |