Craig Tiller | 2808668 | 2017-07-18 14:22:19 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 gRPC authors. |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 3 | * |
Craig Tiller | 2808668 | 2017-07-18 14:22:19 -0700 | [diff] [blame] | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 7 | * |
Craig Tiller | 2808668 | 2017-07-18 14:22:19 -0700 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 9 | * |
Craig Tiller | 2808668 | 2017-07-18 14:22:19 -0700 | [diff] [blame] | 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /* |
| 18 | * Automatically generated by tools/codegen/core/gen_stats_data.py |
| 19 | */ |
| 20 | |
| 21 | #ifndef GRPC_CORE_LIB_DEBUG_STATS_DATA_H |
| 22 | #define GRPC_CORE_LIB_DEBUG_STATS_DATA_H |
| 23 | |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 24 | #include <inttypes.h> |
| 25 | |
Craig Tiller | 2808668 | 2017-07-18 14:22:19 -0700 | [diff] [blame] | 26 | typedef enum { |
| 27 | GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED, |
| 28 | GRPC_STATS_COUNTER_SERVER_CALLS_CREATED, |
Craig Tiller | b4bb1cd | 2017-07-20 14:18:17 -0700 | [diff] [blame] | 29 | GRPC_STATS_COUNTER_SYSCALL_POLL, |
| 30 | GRPC_STATS_COUNTER_SYSCALL_WAIT, |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 31 | GRPC_STATS_COUNTER_HISTOGRAM_SLOW_LOOKUPS, |
Craig Tiller | 57bb9a9 | 2017-08-31 16:44:15 -0700 | [diff] [blame] | 32 | GRPC_STATS_COUNTER_SYSCALL_WRITE, |
| 33 | GRPC_STATS_COUNTER_SYSCALL_READ, |
| 34 | GRPC_STATS_COUNTER_HTTP2_OP_BATCHES, |
| 35 | GRPC_STATS_COUNTER_HTTP2_OP_CANCEL, |
| 36 | GRPC_STATS_COUNTER_HTTP2_OP_SEND_INITIAL_METADATA, |
| 37 | GRPC_STATS_COUNTER_HTTP2_OP_SEND_MESSAGE, |
| 38 | GRPC_STATS_COUNTER_HTTP2_OP_SEND_TRAILING_METADATA, |
| 39 | GRPC_STATS_COUNTER_HTTP2_OP_RECV_INITIAL_METADATA, |
| 40 | GRPC_STATS_COUNTER_HTTP2_OP_RECV_MESSAGE, |
| 41 | GRPC_STATS_COUNTER_HTTP2_OP_RECV_TRAILING_METADATA, |
| 42 | GRPC_STATS_COUNTER_HTTP2_PINGS_SENT, |
| 43 | GRPC_STATS_COUNTER_HTTP2_WRITES_BEGUN, |
| 44 | GRPC_STATS_COUNTER_COMBINER_LOCKS_INITIATED, |
| 45 | GRPC_STATS_COUNTER_COMBINER_LOCKS_SCHEDULED_ITEMS, |
| 46 | GRPC_STATS_COUNTER_COMBINER_LOCKS_SCHEDULED_FINAL_ITEMS, |
| 47 | GRPC_STATS_COUNTER_COMBINER_LOCKS_OFFLOADED, |
| 48 | GRPC_STATS_COUNTER_EXECUTOR_SCHEDULED_ITEMS, |
| 49 | GRPC_STATS_COUNTER_EXECUTOR_SCHEDULED_TO_SELF, |
| 50 | GRPC_STATS_COUNTER_EXECUTOR_WAKEUP_INITIATED, |
| 51 | GRPC_STATS_COUNTER_EXECUTOR_QUEUE_DRAINED, |
Craig Tiller | 2808668 | 2017-07-18 14:22:19 -0700 | [diff] [blame] | 52 | GRPC_STATS_COUNTER_COUNT |
| 53 | } grpc_stats_counters; |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 54 | extern const char *grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT]; |
Craig Tiller | 33aeaba | 2017-07-20 16:02:24 -0700 | [diff] [blame] | 55 | typedef enum { |
| 56 | GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE, |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 57 | GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE, |
Craig Tiller | 33aeaba | 2017-07-20 16:02:24 -0700 | [diff] [blame] | 58 | GRPC_STATS_HISTOGRAM_TCP_READ_SIZE, |
Craig Tiller | c92f18c | 2017-08-31 16:46:32 -0700 | [diff] [blame^] | 59 | GRPC_STATS_HISTOGRAM_TCP_READ_OFFER, |
Craig Tiller | 57bb9a9 | 2017-08-31 16:44:15 -0700 | [diff] [blame] | 60 | GRPC_STATS_HISTOGRAM_TCP_READ_IOV_SIZE, |
| 61 | GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_SIZE, |
Craig Tiller | 33aeaba | 2017-07-20 16:02:24 -0700 | [diff] [blame] | 62 | GRPC_STATS_HISTOGRAM_COUNT |
| 63 | } grpc_stats_histograms; |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 64 | extern const char *grpc_stats_histogram_name[GRPC_STATS_HISTOGRAM_COUNT]; |
| 65 | typedef enum { |
| 66 | GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE_FIRST_SLOT = 0, |
| 67 | GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE_BUCKETS = 64, |
| 68 | GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE_FIRST_SLOT = 64, |
| 69 | GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE_BUCKETS = 64, |
| 70 | GRPC_STATS_HISTOGRAM_TCP_READ_SIZE_FIRST_SLOT = 128, |
| 71 | GRPC_STATS_HISTOGRAM_TCP_READ_SIZE_BUCKETS = 64, |
Craig Tiller | c92f18c | 2017-08-31 16:46:32 -0700 | [diff] [blame^] | 72 | GRPC_STATS_HISTOGRAM_TCP_READ_OFFER_FIRST_SLOT = 192, |
| 73 | GRPC_STATS_HISTOGRAM_TCP_READ_OFFER_BUCKETS = 64, |
| 74 | GRPC_STATS_HISTOGRAM_TCP_READ_IOV_SIZE_FIRST_SLOT = 256, |
Craig Tiller | 57bb9a9 | 2017-08-31 16:44:15 -0700 | [diff] [blame] | 75 | GRPC_STATS_HISTOGRAM_TCP_READ_IOV_SIZE_BUCKETS = 64, |
Craig Tiller | c92f18c | 2017-08-31 16:46:32 -0700 | [diff] [blame^] | 76 | GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_SIZE_FIRST_SLOT = 320, |
Craig Tiller | 57bb9a9 | 2017-08-31 16:44:15 -0700 | [diff] [blame] | 77 | GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_SIZE_BUCKETS = 64, |
Craig Tiller | c92f18c | 2017-08-31 16:46:32 -0700 | [diff] [blame^] | 78 | GRPC_STATS_HISTOGRAM_BUCKETS = 384 |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 79 | } grpc_stats_histogram_constants; |
| 80 | #define GRPC_STATS_INC_CLIENT_CALLS_CREATED(exec_ctx) \ |
| 81 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_CLIENT_CALLS_CREATED) |
| 82 | #define GRPC_STATS_INC_SERVER_CALLS_CREATED(exec_ctx) \ |
| 83 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_SERVER_CALLS_CREATED) |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 84 | #define GRPC_STATS_INC_SYSCALL_POLL(exec_ctx) \ |
| 85 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_SYSCALL_POLL) |
| 86 | #define GRPC_STATS_INC_SYSCALL_WAIT(exec_ctx) \ |
| 87 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_SYSCALL_WAIT) |
| 88 | #define GRPC_STATS_INC_HISTOGRAM_SLOW_LOOKUPS(exec_ctx) \ |
| 89 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HISTOGRAM_SLOW_LOOKUPS) |
Craig Tiller | 57bb9a9 | 2017-08-31 16:44:15 -0700 | [diff] [blame] | 90 | #define GRPC_STATS_INC_SYSCALL_WRITE(exec_ctx) \ |
| 91 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_SYSCALL_WRITE) |
| 92 | #define GRPC_STATS_INC_SYSCALL_READ(exec_ctx) \ |
| 93 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_SYSCALL_READ) |
| 94 | #define GRPC_STATS_INC_HTTP2_OP_BATCHES(exec_ctx) \ |
| 95 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HTTP2_OP_BATCHES) |
| 96 | #define GRPC_STATS_INC_HTTP2_OP_CANCEL(exec_ctx) \ |
| 97 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HTTP2_OP_CANCEL) |
| 98 | #define GRPC_STATS_INC_HTTP2_OP_SEND_INITIAL_METADATA(exec_ctx) \ |
| 99 | GRPC_STATS_INC_COUNTER((exec_ctx), \ |
| 100 | GRPC_STATS_COUNTER_HTTP2_OP_SEND_INITIAL_METADATA) |
| 101 | #define GRPC_STATS_INC_HTTP2_OP_SEND_MESSAGE(exec_ctx) \ |
| 102 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HTTP2_OP_SEND_MESSAGE) |
| 103 | #define GRPC_STATS_INC_HTTP2_OP_SEND_TRAILING_METADATA(exec_ctx) \ |
| 104 | GRPC_STATS_INC_COUNTER((exec_ctx), \ |
| 105 | GRPC_STATS_COUNTER_HTTP2_OP_SEND_TRAILING_METADATA) |
| 106 | #define GRPC_STATS_INC_HTTP2_OP_RECV_INITIAL_METADATA(exec_ctx) \ |
| 107 | GRPC_STATS_INC_COUNTER((exec_ctx), \ |
| 108 | GRPC_STATS_COUNTER_HTTP2_OP_RECV_INITIAL_METADATA) |
| 109 | #define GRPC_STATS_INC_HTTP2_OP_RECV_MESSAGE(exec_ctx) \ |
| 110 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HTTP2_OP_RECV_MESSAGE) |
| 111 | #define GRPC_STATS_INC_HTTP2_OP_RECV_TRAILING_METADATA(exec_ctx) \ |
| 112 | GRPC_STATS_INC_COUNTER((exec_ctx), \ |
| 113 | GRPC_STATS_COUNTER_HTTP2_OP_RECV_TRAILING_METADATA) |
| 114 | #define GRPC_STATS_INC_HTTP2_PINGS_SENT(exec_ctx) \ |
| 115 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HTTP2_PINGS_SENT) |
| 116 | #define GRPC_STATS_INC_HTTP2_WRITES_BEGUN(exec_ctx) \ |
| 117 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_HTTP2_WRITES_BEGUN) |
| 118 | #define GRPC_STATS_INC_COMBINER_LOCKS_INITIATED(exec_ctx) \ |
| 119 | GRPC_STATS_INC_COUNTER((exec_ctx), \ |
| 120 | GRPC_STATS_COUNTER_COMBINER_LOCKS_INITIATED) |
| 121 | #define GRPC_STATS_INC_COMBINER_LOCKS_SCHEDULED_ITEMS(exec_ctx) \ |
| 122 | GRPC_STATS_INC_COUNTER((exec_ctx), \ |
| 123 | GRPC_STATS_COUNTER_COMBINER_LOCKS_SCHEDULED_ITEMS) |
| 124 | #define GRPC_STATS_INC_COMBINER_LOCKS_SCHEDULED_FINAL_ITEMS(exec_ctx) \ |
| 125 | GRPC_STATS_INC_COUNTER( \ |
| 126 | (exec_ctx), GRPC_STATS_COUNTER_COMBINER_LOCKS_SCHEDULED_FINAL_ITEMS) |
| 127 | #define GRPC_STATS_INC_COMBINER_LOCKS_OFFLOADED(exec_ctx) \ |
| 128 | GRPC_STATS_INC_COUNTER((exec_ctx), \ |
| 129 | GRPC_STATS_COUNTER_COMBINER_LOCKS_OFFLOADED) |
| 130 | #define GRPC_STATS_INC_EXECUTOR_SCHEDULED_ITEMS(exec_ctx) \ |
| 131 | GRPC_STATS_INC_COUNTER((exec_ctx), \ |
| 132 | GRPC_STATS_COUNTER_EXECUTOR_SCHEDULED_ITEMS) |
| 133 | #define GRPC_STATS_INC_EXECUTOR_SCHEDULED_TO_SELF(exec_ctx) \ |
| 134 | GRPC_STATS_INC_COUNTER((exec_ctx), \ |
| 135 | GRPC_STATS_COUNTER_EXECUTOR_SCHEDULED_TO_SELF) |
| 136 | #define GRPC_STATS_INC_EXECUTOR_WAKEUP_INITIATED(exec_ctx) \ |
| 137 | GRPC_STATS_INC_COUNTER((exec_ctx), \ |
| 138 | GRPC_STATS_COUNTER_EXECUTOR_WAKEUP_INITIATED) |
| 139 | #define GRPC_STATS_INC_EXECUTOR_QUEUE_DRAINED(exec_ctx) \ |
| 140 | GRPC_STATS_INC_COUNTER((exec_ctx), GRPC_STATS_COUNTER_EXECUTOR_QUEUE_DRAINED) |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 141 | #define GRPC_STATS_INC_TCP_WRITE_SIZE(exec_ctx, value) \ |
| 142 | do { \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 143 | union { \ |
| 144 | double dbl; \ |
| 145 | uint64_t uint; \ |
| 146 | } _val; \ |
| 147 | _val.dbl = (double)(value); \ |
| 148 | if (_val.dbl < 0) _val.dbl = 0; \ |
| 149 | if (_val.dbl < 5.000000) { \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 150 | GRPC_STATS_INC_HISTOGRAM( \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 151 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE, (int)_val.dbl); \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 152 | } else { \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 153 | if (_val.uint < 4715268809856909312ull) { \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 154 | GRPC_STATS_INC_HISTOGRAM( \ |
| 155 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE, \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 156 | grpc_stats_table_1[((_val.uint - 4617315517961601024ull) >> 50)]); \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 157 | } else { \ |
| 158 | GRPC_STATS_INC_HISTOGRAM( \ |
| 159 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE, \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 160 | grpc_stats_histo_find_bucket_slow((exec_ctx), _val.dbl, \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 161 | grpc_stats_table_0, 64)); \ |
| 162 | } \ |
| 163 | } \ |
| 164 | } while (false) |
| 165 | #define GRPC_STATS_INC_TCP_WRITE_IOV_SIZE(exec_ctx, value) \ |
| 166 | do { \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 167 | union { \ |
| 168 | double dbl; \ |
| 169 | uint64_t uint; \ |
| 170 | } _val; \ |
| 171 | _val.dbl = (double)(value); \ |
| 172 | if (_val.dbl < 0) _val.dbl = 0; \ |
| 173 | if (_val.dbl < 12.000000) { \ |
| 174 | GRPC_STATS_INC_HISTOGRAM( \ |
| 175 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE, (int)_val.dbl); \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 176 | } else { \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 177 | if (_val.uint < 4652218415073722368ull) { \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 178 | GRPC_STATS_INC_HISTOGRAM( \ |
| 179 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE, \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 180 | grpc_stats_table_3[((_val.uint - 4622945017495814144ull) >> 49)]); \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 181 | } else { \ |
| 182 | GRPC_STATS_INC_HISTOGRAM( \ |
| 183 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE, \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 184 | grpc_stats_histo_find_bucket_slow((exec_ctx), _val.dbl, \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 185 | grpc_stats_table_2, 64)); \ |
| 186 | } \ |
| 187 | } \ |
| 188 | } while (false) |
| 189 | #define GRPC_STATS_INC_TCP_READ_SIZE(exec_ctx, value) \ |
| 190 | do { \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 191 | union { \ |
| 192 | double dbl; \ |
| 193 | uint64_t uint; \ |
| 194 | } _val; \ |
| 195 | _val.dbl = (double)(value); \ |
| 196 | if (_val.dbl < 0) _val.dbl = 0; \ |
| 197 | if (_val.dbl < 5.000000) { \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 198 | GRPC_STATS_INC_HISTOGRAM((exec_ctx), GRPC_STATS_HISTOGRAM_TCP_READ_SIZE, \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 199 | (int)_val.dbl); \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 200 | } else { \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 201 | if (_val.uint < 4715268809856909312ull) { \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 202 | GRPC_STATS_INC_HISTOGRAM( \ |
| 203 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_READ_SIZE, \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 204 | grpc_stats_table_1[((_val.uint - 4617315517961601024ull) >> 50)]); \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 205 | } else { \ |
| 206 | GRPC_STATS_INC_HISTOGRAM( \ |
| 207 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_READ_SIZE, \ |
Craig Tiller | 5489d41 | 2017-08-31 12:20:04 -0700 | [diff] [blame] | 208 | grpc_stats_histo_find_bucket_slow((exec_ctx), _val.dbl, \ |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 209 | grpc_stats_table_0, 64)); \ |
| 210 | } \ |
| 211 | } \ |
| 212 | } while (false) |
Craig Tiller | c92f18c | 2017-08-31 16:46:32 -0700 | [diff] [blame^] | 213 | #define GRPC_STATS_INC_TCP_READ_OFFER(exec_ctx, value) \ |
| 214 | do { \ |
| 215 | union { \ |
| 216 | double dbl; \ |
| 217 | uint64_t uint; \ |
| 218 | } _val; \ |
| 219 | _val.dbl = (double)(value); \ |
| 220 | if (_val.dbl < 0) _val.dbl = 0; \ |
| 221 | if (_val.dbl < 5.000000) { \ |
| 222 | GRPC_STATS_INC_HISTOGRAM( \ |
| 223 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_READ_OFFER, (int)_val.dbl); \ |
| 224 | } else { \ |
| 225 | if (_val.uint < 4715268809856909312ull) { \ |
| 226 | GRPC_STATS_INC_HISTOGRAM( \ |
| 227 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_READ_OFFER, \ |
| 228 | grpc_stats_table_1[((_val.uint - 4617315517961601024ull) >> 50)]); \ |
| 229 | } else { \ |
| 230 | GRPC_STATS_INC_HISTOGRAM( \ |
| 231 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_READ_OFFER, \ |
| 232 | grpc_stats_histo_find_bucket_slow((exec_ctx), _val.dbl, \ |
| 233 | grpc_stats_table_0, 64)); \ |
| 234 | } \ |
| 235 | } \ |
| 236 | } while (false) |
Craig Tiller | 57bb9a9 | 2017-08-31 16:44:15 -0700 | [diff] [blame] | 237 | #define GRPC_STATS_INC_TCP_READ_IOV_SIZE(exec_ctx, value) \ |
| 238 | do { \ |
| 239 | union { \ |
| 240 | double dbl; \ |
| 241 | uint64_t uint; \ |
| 242 | } _val; \ |
| 243 | _val.dbl = (double)(value); \ |
| 244 | if (_val.dbl < 0) _val.dbl = 0; \ |
| 245 | if (_val.dbl < 12.000000) { \ |
| 246 | GRPC_STATS_INC_HISTOGRAM( \ |
| 247 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_READ_IOV_SIZE, (int)_val.dbl); \ |
| 248 | } else { \ |
| 249 | if (_val.uint < 4652218415073722368ull) { \ |
| 250 | GRPC_STATS_INC_HISTOGRAM( \ |
| 251 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_READ_IOV_SIZE, \ |
| 252 | grpc_stats_table_3[((_val.uint - 4622945017495814144ull) >> 49)]); \ |
| 253 | } else { \ |
| 254 | GRPC_STATS_INC_HISTOGRAM( \ |
| 255 | (exec_ctx), GRPC_STATS_HISTOGRAM_TCP_READ_IOV_SIZE, \ |
| 256 | grpc_stats_histo_find_bucket_slow((exec_ctx), _val.dbl, \ |
| 257 | grpc_stats_table_2, 64)); \ |
| 258 | } \ |
| 259 | } \ |
| 260 | } while (false) |
| 261 | #define GRPC_STATS_INC_HTTP2_SEND_MESSAGE_SIZE(exec_ctx, value) \ |
| 262 | do { \ |
| 263 | union { \ |
| 264 | double dbl; \ |
| 265 | uint64_t uint; \ |
| 266 | } _val; \ |
| 267 | _val.dbl = (double)(value); \ |
| 268 | if (_val.dbl < 0) _val.dbl = 0; \ |
| 269 | if (_val.dbl < 5.000000) { \ |
| 270 | GRPC_STATS_INC_HISTOGRAM((exec_ctx), \ |
| 271 | GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_SIZE, \ |
| 272 | (int)_val.dbl); \ |
| 273 | } else { \ |
| 274 | if (_val.uint < 4715268809856909312ull) { \ |
| 275 | GRPC_STATS_INC_HISTOGRAM( \ |
| 276 | (exec_ctx), GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_SIZE, \ |
| 277 | grpc_stats_table_1[((_val.uint - 4617315517961601024ull) >> 50)]); \ |
| 278 | } else { \ |
| 279 | GRPC_STATS_INC_HISTOGRAM( \ |
| 280 | (exec_ctx), GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_SIZE, \ |
| 281 | grpc_stats_histo_find_bucket_slow((exec_ctx), _val.dbl, \ |
| 282 | grpc_stats_table_0, 64)); \ |
| 283 | } \ |
| 284 | } \ |
| 285 | } while (false) |
Craig Tiller | 640dfe4 | 2017-08-30 13:34:49 -0700 | [diff] [blame] | 286 | extern const double grpc_stats_table_0[64]; |
| 287 | extern const uint8_t grpc_stats_table_1[87]; |
| 288 | extern const double grpc_stats_table_2[64]; |
| 289 | extern const uint8_t grpc_stats_table_3[52]; |
Craig Tiller | c92f18c | 2017-08-31 16:46:32 -0700 | [diff] [blame^] | 290 | extern const int grpc_stats_histo_buckets[6]; |
| 291 | extern const int grpc_stats_histo_start[6]; |
| 292 | extern const double *const grpc_stats_histo_bucket_boundaries[6]; |
Craig Tiller | 2808668 | 2017-07-18 14:22:19 -0700 | [diff] [blame] | 293 | |
| 294 | #endif /* GRPC_CORE_LIB_DEBUG_STATS_DATA_H */ |