grpc 1.49.1-x86_64-linux → 1.50.0-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of grpc might be problematic. Click here for more details.

Files changed (275) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +54 -153
  3. data/include/grpc/event_engine/endpoint_config.h +11 -5
  4. data/include/grpc/event_engine/event_engine.h +1 -1
  5. data/include/grpc/impl/codegen/atm_gcc_atomic.h +19 -28
  6. data/include/grpc/impl/codegen/atm_gcc_sync.h +0 -2
  7. data/include/grpc/impl/codegen/atm_windows.h +0 -2
  8. data/include/grpc/impl/codegen/grpc_types.h +6 -0
  9. data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +3 -3
  10. data/src/core/ext/filters/client_channel/backup_poller.cc +4 -6
  11. data/src/core/ext/filters/client_channel/client_channel.cc +33 -22
  12. data/src/core/ext/filters/client_channel/client_channel.h +1 -1
  13. data/src/core/ext/filters/client_channel/client_channel_plugin.cc +0 -16
  14. data/src/core/ext/filters/client_channel/http_proxy.cc +12 -19
  15. data/src/core/ext/filters/client_channel/http_proxy.h +3 -2
  16. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +6 -4
  17. data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +5 -4
  18. data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +0 -2
  19. data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +112 -96
  20. data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +20 -11
  21. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +106 -108
  22. data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +16 -0
  23. data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +20 -13
  24. data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +165 -257
  25. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +218 -231
  26. data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h +10 -6
  27. data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +389 -444
  28. data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +16 -16
  29. data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +8 -13
  30. data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +84 -96
  31. data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +38 -37
  32. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +106 -186
  33. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +106 -93
  34. data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +170 -218
  35. data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +2 -2
  36. data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +1 -1
  37. data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +13 -15
  38. data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +84 -37
  39. data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +11 -0
  40. data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +1 -0
  41. data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +5 -3
  42. data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +5 -4
  43. data/src/core/ext/filters/client_channel/retry_filter.cc +25 -29
  44. data/src/core/ext/filters/client_channel/subchannel.cc +38 -33
  45. data/src/core/ext/filters/client_channel/subchannel.h +12 -3
  46. data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +1 -2
  47. data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +23 -16
  48. data/src/core/ext/filters/fault_injection/fault_injection_filter.h +8 -0
  49. data/src/core/ext/filters/http/client/http_client_filter.cc +1 -2
  50. data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +2 -4
  51. data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +0 -2
  52. data/src/core/ext/filters/http/server/http_server_filter.cc +1 -2
  53. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +12 -8
  54. data/src/core/ext/transport/chttp2/server/chttp2_server.cc +32 -26
  55. data/src/core/ext/transport/chttp2/transport/bin_encoder.cc +1 -1
  56. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +25 -130
  57. data/src/core/ext/transport/chttp2/transport/decode_huff.cc +287 -0
  58. data/src/core/ext/transport/chttp2/transport/decode_huff.h +1018 -0
  59. data/src/core/ext/transport/chttp2/transport/flow_control.cc +83 -51
  60. data/src/core/ext/transport/chttp2/transport/flow_control.h +11 -6
  61. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +1 -2
  62. data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +2 -20
  63. data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +28 -28
  64. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +1 -10
  65. data/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +11 -6
  66. data/src/core/ext/transport/chttp2/transport/internal.h +2 -0
  67. data/src/core/ext/transport/chttp2/transport/parsing.cc +44 -0
  68. data/src/core/ext/transport/chttp2/transport/writing.cc +3 -14
  69. data/src/core/ext/transport/inproc/inproc_transport.cc +1 -3
  70. data/src/core/ext/xds/certificate_provider_store.cc +63 -3
  71. data/src/core/ext/xds/certificate_provider_store.h +9 -1
  72. data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +5 -5
  73. data/src/core/ext/xds/file_watcher_certificate_provider_factory.h +1 -1
  74. data/src/core/ext/xds/xds_api.cc +21 -17
  75. data/src/core/ext/xds/xds_api.h +7 -0
  76. data/src/core/ext/xds/xds_bootstrap.cc +5 -537
  77. data/src/core/ext/xds/xds_bootstrap.h +39 -111
  78. data/src/core/ext/xds/xds_bootstrap_grpc.cc +370 -0
  79. data/src/core/ext/xds/xds_bootstrap_grpc.h +169 -0
  80. data/src/core/ext/xds/xds_client.cc +219 -145
  81. data/src/core/ext/xds/xds_client.h +19 -17
  82. data/src/core/ext/xds/xds_client_grpc.cc +18 -80
  83. data/src/core/ext/xds/xds_client_grpc.h +2 -25
  84. data/src/core/ext/xds/xds_client_stats.cc +4 -4
  85. data/src/core/ext/xds/xds_cluster.cc +87 -79
  86. data/src/core/ext/xds/xds_cluster.h +5 -5
  87. data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +3 -1
  88. data/src/core/ext/xds/xds_common_types.cc +13 -5
  89. data/src/core/ext/xds/xds_endpoint.cc +8 -6
  90. data/src/core/ext/xds/xds_endpoint.h +3 -4
  91. data/src/core/ext/xds/xds_lb_policy_registry.cc +4 -2
  92. data/src/core/ext/xds/xds_listener.cc +25 -20
  93. data/src/core/ext/xds/xds_listener.h +3 -4
  94. data/src/core/ext/xds/xds_resource_type.h +11 -8
  95. data/src/core/ext/xds/xds_route_config.cc +15 -16
  96. data/src/core/ext/xds/xds_route_config.h +3 -3
  97. data/src/core/ext/xds/xds_server_config_fetcher.cc +7 -5
  98. data/src/core/ext/xds/xds_transport_grpc.cc +15 -7
  99. data/src/core/lib/backoff/backoff.cc +2 -4
  100. data/src/core/lib/channel/call_finalization.h +1 -3
  101. data/src/core/lib/channel/channel_args.h +114 -14
  102. data/src/core/lib/channel/channel_trace.cc +3 -4
  103. data/src/core/lib/channel/promise_based_filter.cc +18 -19
  104. data/src/core/lib/channel/status_util.cc +27 -0
  105. data/src/core/lib/channel/status_util.h +10 -0
  106. data/src/core/lib/config/core_configuration.cc +5 -1
  107. data/src/core/lib/config/core_configuration.h +33 -0
  108. data/src/core/lib/debug/stats.cc +26 -30
  109. data/src/core/lib/debug/stats.h +2 -12
  110. data/src/core/lib/debug/stats_data.cc +118 -614
  111. data/src/core/lib/debug/stats_data.h +67 -465
  112. data/src/core/lib/debug/trace.cc +0 -2
  113. data/src/core/lib/event_engine/channel_args_endpoint_config.cc +12 -20
  114. data/src/core/lib/event_engine/channel_args_endpoint_config.h +13 -7
  115. data/src/core/lib/event_engine/forkable.cc +1 -1
  116. data/src/core/lib/event_engine/poller.h +14 -12
  117. data/src/core/lib/event_engine/posix_engine/timer_manager.cc +53 -32
  118. data/src/core/lib/event_engine/posix_engine/timer_manager.h +23 -1
  119. data/src/core/lib/event_engine/thread_pool.cc +131 -94
  120. data/src/core/lib/event_engine/thread_pool.h +56 -23
  121. data/src/core/lib/event_engine/time_util.cc +30 -0
  122. data/src/core/lib/event_engine/time_util.h +32 -0
  123. data/src/core/lib/event_engine/utils.cc +0 -5
  124. data/src/core/lib/event_engine/utils.h +0 -4
  125. data/src/core/lib/event_engine/windows/iocp.cc +13 -7
  126. data/src/core/lib/event_engine/windows/iocp.h +2 -1
  127. data/src/core/lib/event_engine/windows/win_socket.cc +1 -1
  128. data/src/core/lib/experiments/config.cc +146 -0
  129. data/src/core/lib/experiments/config.h +43 -0
  130. data/src/core/lib/experiments/experiments.cc +75 -0
  131. data/src/core/lib/experiments/experiments.h +56 -0
  132. data/src/core/lib/gpr/alloc.cc +1 -9
  133. data/src/core/lib/gpr/log_windows.cc +0 -1
  134. data/src/core/lib/gpr/string_util_windows.cc +3 -30
  135. data/src/core/lib/gpr/sync_abseil.cc +0 -14
  136. data/src/core/lib/gpr/sync_posix.cc +0 -14
  137. data/src/core/lib/gpr/time_posix.cc +0 -6
  138. data/src/core/lib/gpr/time_precise.h +1 -1
  139. data/src/core/lib/gpr/tmpfile_windows.cc +5 -7
  140. data/src/core/lib/gpr/useful.h +11 -0
  141. data/src/core/lib/{gpr → gprpp}/env.h +25 -12
  142. data/src/core/lib/{gpr → gprpp}/env_linux.cc +20 -15
  143. data/src/core/lib/{gpr → gprpp}/env_posix.cc +11 -10
  144. data/src/core/lib/gprpp/env_windows.cc +56 -0
  145. data/src/core/lib/gprpp/fork.cc +14 -22
  146. data/src/core/lib/gprpp/fork.h +0 -8
  147. data/src/core/lib/gprpp/global_config_env.cc +7 -6
  148. data/src/core/lib/gprpp/notification.h +67 -0
  149. data/src/core/lib/gprpp/packed_table.h +40 -0
  150. data/src/core/lib/gprpp/ref_counted_ptr.h +20 -33
  151. data/src/core/lib/gprpp/sorted_pack.h +98 -0
  152. data/src/core/lib/gprpp/status_helper.h +6 -0
  153. data/src/core/lib/gprpp/table.h +9 -1
  154. data/src/core/lib/gprpp/tchar.cc +49 -0
  155. data/src/core/lib/gprpp/tchar.h +33 -0
  156. data/src/core/lib/gprpp/time.cc +21 -0
  157. data/src/core/lib/gprpp/time.h +55 -0
  158. data/src/core/lib/gprpp/validation_errors.cc +61 -0
  159. data/src/core/lib/gprpp/validation_errors.h +110 -0
  160. data/src/core/{ext/filters/client_channel → lib/handshaker}/proxy_mapper.h +3 -3
  161. data/src/core/{ext/filters/client_channel → lib/handshaker}/proxy_mapper_registry.cc +14 -36
  162. data/src/core/lib/handshaker/proxy_mapper_registry.h +75 -0
  163. data/src/core/lib/iomgr/call_combiner.cc +0 -8
  164. data/src/core/lib/iomgr/closure.h +0 -1
  165. data/src/core/lib/iomgr/endpoint_pair_posix.cc +14 -10
  166. data/src/core/lib/iomgr/endpoint_pair_windows.cc +2 -2
  167. data/src/core/lib/iomgr/ev_epoll1_linux.cc +1 -38
  168. data/src/core/lib/iomgr/ev_poll_posix.cc +2 -17
  169. data/src/core/lib/iomgr/exec_ctx.cc +0 -10
  170. data/src/core/lib/iomgr/exec_ctx.h +7 -31
  171. data/src/core/lib/iomgr/iocp_windows.cc +1 -2
  172. data/src/core/lib/iomgr/iomgr.cc +6 -8
  173. data/src/core/lib/iomgr/iomgr_fwd.h +1 -0
  174. data/src/core/lib/iomgr/pollset.h +1 -1
  175. data/src/core/lib/iomgr/pollset_set.h +0 -1
  176. data/src/core/lib/iomgr/resolve_address.h +1 -0
  177. data/src/core/lib/iomgr/resolve_address_impl.h +1 -0
  178. data/src/core/lib/iomgr/resolve_address_posix.cc +1 -0
  179. data/src/core/lib/iomgr/resolve_address_windows.cc +1 -0
  180. data/src/core/lib/iomgr/sockaddr_utils_posix.cc +2 -1
  181. data/src/core/lib/iomgr/socket_utils_common_posix.cc +12 -34
  182. data/src/core/lib/iomgr/socket_utils_posix.cc +83 -1
  183. data/src/core/lib/iomgr/socket_utils_posix.h +98 -6
  184. data/src/core/lib/iomgr/tcp_client.cc +6 -7
  185. data/src/core/lib/iomgr/tcp_client.h +11 -11
  186. data/src/core/lib/iomgr/tcp_client_cfstream.cc +6 -6
  187. data/src/core/lib/iomgr/tcp_client_posix.cc +33 -29
  188. data/src/core/lib/iomgr/tcp_client_posix.h +12 -9
  189. data/src/core/lib/iomgr/tcp_client_windows.cc +6 -6
  190. data/src/core/lib/iomgr/tcp_posix.cc +131 -114
  191. data/src/core/lib/iomgr/tcp_posix.h +3 -1
  192. data/src/core/lib/iomgr/tcp_server.cc +5 -4
  193. data/src/core/lib/iomgr/tcp_server.h +9 -6
  194. data/src/core/lib/iomgr/tcp_server_posix.cc +17 -28
  195. data/src/core/lib/iomgr/tcp_server_utils_posix.h +2 -2
  196. data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +3 -3
  197. data/src/core/lib/iomgr/tcp_server_windows.cc +6 -7
  198. data/src/core/lib/iomgr/tcp_windows.cc +0 -1
  199. data/src/core/lib/iomgr/tcp_windows.h +0 -1
  200. data/src/core/lib/iomgr/timer_generic.cc +4 -4
  201. data/src/core/lib/iomgr/timer_manager.cc +1 -2
  202. data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +0 -2
  203. data/src/core/lib/json/json_object_loader.cc +21 -52
  204. data/src/core/lib/json/json_object_loader.h +56 -76
  205. data/src/core/lib/json/json_util.cc +2 -1
  206. data/src/core/lib/load_balancing/lb_policy.h +5 -5
  207. data/src/core/lib/load_balancing/lb_policy_registry.cc +29 -55
  208. data/src/core/lib/load_balancing/lb_policy_registry.h +23 -11
  209. data/src/core/lib/promise/activity.h +2 -3
  210. data/src/core/lib/promise/context.h +1 -1
  211. data/src/core/lib/promise/sleep.cc +16 -4
  212. data/src/core/lib/promise/sleep.h +8 -2
  213. data/src/core/lib/resolver/resolver.h +13 -3
  214. data/src/core/lib/resource_quota/api.cc +9 -0
  215. data/src/core/lib/resource_quota/api.h +6 -0
  216. data/src/core/lib/resource_quota/arena.cc +1 -3
  217. data/src/core/lib/resource_quota/memory_quota.cc +8 -24
  218. data/src/core/lib/resource_quota/memory_quota.h +6 -19
  219. data/src/core/lib/resource_quota/periodic_update.cc +2 -3
  220. data/src/core/{ext/xds → lib/security/certificate_provider}/certificate_provider_factory.h +3 -3
  221. data/src/core/lib/security/certificate_provider/certificate_provider_registry.cc +60 -0
  222. data/src/core/lib/security/certificate_provider/certificate_provider_registry.h +70 -0
  223. data/src/core/lib/security/credentials/channel_creds_registry_init.cc +1 -0
  224. data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +15 -16
  225. data/src/core/lib/security/credentials/external/external_account_credentials.cc +2 -1
  226. data/src/core/lib/security/credentials/google_default/credentials_generic.cc +5 -8
  227. data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +6 -6
  228. data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +3 -2
  229. data/src/core/lib/security/credentials/jwt/jwt_verifier.h +1 -1
  230. data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +1 -2
  231. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +4 -3
  232. data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +4 -2
  233. data/src/core/lib/security/credentials/tls/tls_utils.cc +3 -1
  234. data/src/core/lib/security/transport/client_auth_filter.cc +12 -1
  235. data/src/core/lib/security/transport/secure_endpoint.cc +0 -4
  236. data/src/core/lib/surface/call.cc +1 -11
  237. data/src/core/lib/surface/channel.cc +3 -2
  238. data/src/core/lib/surface/completion_queue.cc +16 -28
  239. data/src/core/lib/surface/completion_queue.h +1 -1
  240. data/src/core/lib/surface/completion_queue_factory.cc +5 -0
  241. data/src/core/lib/surface/init.cc +16 -11
  242. data/src/core/lib/surface/init_internally.cc +24 -0
  243. data/src/core/lib/surface/init_internally.h +28 -0
  244. data/src/core/lib/surface/server.cc +1 -7
  245. data/src/core/lib/surface/server.h +4 -6
  246. data/src/core/lib/surface/version.cc +2 -2
  247. data/src/core/lib/transport/bdp_estimator.cc +1 -3
  248. data/src/core/lib/transport/metadata_batch.cc +2 -3
  249. data/src/core/lib/transport/metadata_batch.h +9 -7
  250. data/src/core/lib/transport/parsed_metadata.h +4 -2
  251. data/src/core/lib/transport/status_conversion.cc +1 -3
  252. data/src/core/lib/transport/tcp_connect_handshaker.cc +9 -5
  253. data/src/core/lib/transport/transport.h +0 -1
  254. data/src/core/lib/transport/transport_impl.h +0 -1
  255. data/src/core/plugin_registry/grpc_plugin_registry.cc +23 -46
  256. data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +13 -25
  257. data/src/ruby/lib/grpc/2.6/grpc_c.so +0 -0
  258. data/src/ruby/lib/grpc/2.7/grpc_c.so +0 -0
  259. data/src/ruby/lib/grpc/3.0/grpc_c.so +0 -0
  260. data/src/ruby/lib/grpc/3.1/grpc_c.so +0 -0
  261. data/src/ruby/lib/grpc/grpc_c.so +0 -0
  262. data/src/ruby/lib/grpc/version.rb +1 -1
  263. data/src/ruby/spec/channel_spec.rb +5 -0
  264. data/src/ruby/spec/generic/server_interceptors_spec.rb +1 -1
  265. data/src/ruby/spec/user_agent_spec.rb +1 -1
  266. metadata +31 -17
  267. data/src/core/ext/filters/client_channel/proxy_mapper_registry.h +0 -56
  268. data/src/core/ext/xds/certificate_provider_registry.cc +0 -103
  269. data/src/core/ext/xds/certificate_provider_registry.h +0 -59
  270. data/src/core/lib/event_engine/promise.h +0 -78
  271. data/src/core/lib/gpr/env_windows.cc +0 -74
  272. data/src/core/lib/gpr/string_windows.h +0 -32
  273. data/src/core/lib/profiling/basic_timers.cc +0 -295
  274. data/src/core/lib/profiling/stap_timers.cc +0 -50
  275. data/src/core/lib/profiling/timers.h +0 -94
@@ -22,665 +22,169 @@
22
22
 
23
23
  #include "src/core/lib/debug/stats_data.h"
24
24
 
25
- #include <inttypes.h>
25
+ #include <stdint.h>
26
26
 
27
27
  #include "src/core/lib/debug/stats.h"
28
- #include "src/core/lib/gpr/useful.h"
29
28
 
29
+ namespace {
30
+ union DblUint {
31
+ double dbl;
32
+ uint64_t uint;
33
+ };
34
+ } // namespace
30
35
  const char* grpc_stats_counter_name[GRPC_STATS_COUNTER_COUNT] = {
31
36
  "client_calls_created",
32
37
  "server_calls_created",
33
- "cqs_created",
34
38
  "client_channels_created",
35
39
  "client_subchannels_created",
36
40
  "server_channels_created",
37
- "syscall_poll",
38
- "syscall_wait",
39
- "pollset_kick",
40
- "pollset_kicked_without_poller",
41
- "pollset_kicked_again",
42
- "pollset_kick_wakeup_fd",
43
- "pollset_kick_wakeup_cv",
44
- "pollset_kick_own_thread",
45
- "histogram_slow_lookups",
46
41
  "syscall_write",
47
42
  "syscall_read",
48
- "tcp_backup_pollers_created",
49
- "tcp_backup_poller_polls",
50
- "http2_op_batches",
51
- "http2_op_cancel",
52
- "http2_op_send_initial_metadata",
53
- "http2_op_send_message",
54
- "http2_op_send_trailing_metadata",
55
- "http2_op_recv_initial_metadata",
56
- "http2_op_recv_message",
57
- "http2_op_recv_trailing_metadata",
43
+ "tcp_read_alloc_8k",
44
+ "tcp_read_alloc_64k",
58
45
  "http2_settings_writes",
59
46
  "http2_pings_sent",
60
47
  "http2_writes_begun",
61
- "http2_writes_offloaded",
62
- "http2_writes_continued",
63
- "http2_partial_writes",
64
- "http2_initiate_write_due_to_initial_write",
65
- "http2_initiate_write_due_to_start_new_stream",
66
- "http2_initiate_write_due_to_send_message",
67
- "http2_initiate_write_due_to_send_initial_metadata",
68
- "http2_initiate_write_due_to_send_trailing_metadata",
69
- "http2_initiate_write_due_to_retry_send_ping",
70
- "http2_initiate_write_due_to_continue_pings",
71
- "http2_initiate_write_due_to_goaway_sent",
72
- "http2_initiate_write_due_to_rst_stream",
73
- "http2_initiate_write_due_to_close_from_api",
74
- "http2_initiate_write_due_to_stream_flow_control",
75
- "http2_initiate_write_due_to_transport_flow_control",
76
- "http2_initiate_write_due_to_send_settings",
77
- "http2_initiate_write_due_to_settings_ack",
78
- "http2_initiate_write_due_to_bdp_estimator_ping",
79
- "http2_initiate_write_due_to_flow_control_unstalled_by_setting",
80
- "http2_initiate_write_due_to_flow_control_unstalled_by_update",
81
- "http2_initiate_write_due_to_application_ping",
82
- "http2_initiate_write_due_to_keepalive_ping",
83
- "http2_initiate_write_due_to_transport_flow_control_unstalled",
84
- "http2_initiate_write_due_to_ping_response",
85
- "http2_initiate_write_due_to_force_rst_stream",
86
- "http2_spurious_writes_begun",
87
- "hpack_recv_indexed",
88
- "hpack_recv_lithdr_incidx",
89
- "hpack_recv_lithdr_incidx_v",
90
- "hpack_recv_lithdr_notidx",
91
- "hpack_recv_lithdr_notidx_v",
92
- "hpack_recv_lithdr_nvridx",
93
- "hpack_recv_lithdr_nvridx_v",
94
- "hpack_recv_uncompressed",
95
- "hpack_recv_huffman",
96
- "hpack_recv_binary",
97
- "hpack_recv_binary_base64",
98
- "hpack_send_indexed",
99
- "hpack_send_lithdr_incidx",
100
- "hpack_send_lithdr_incidx_v",
101
- "hpack_send_lithdr_notidx",
102
- "hpack_send_lithdr_notidx_v",
103
- "hpack_send_lithdr_nvridx",
104
- "hpack_send_lithdr_nvridx_v",
105
- "hpack_send_uncompressed",
106
- "hpack_send_huffman",
107
- "hpack_send_binary",
108
- "hpack_send_binary_base64",
109
- "combiner_locks_initiated",
110
- "combiner_locks_scheduled_items",
111
- "combiner_locks_scheduled_final_items",
112
- "combiner_locks_offloaded",
113
- "call_combiner_locks_initiated",
114
- "call_combiner_locks_scheduled_items",
115
- "call_combiner_set_notify_on_cancel",
116
- "call_combiner_cancelled",
117
- "executor_scheduled_short_items",
118
- "executor_scheduled_long_items",
119
- "executor_scheduled_to_self",
120
- "executor_wakeup_initiated",
121
- "executor_queue_drained",
122
- "executor_push_retries",
123
- "server_requested_calls",
124
- "server_slowpath_requests_queued",
125
- "cq_ev_queue_trylock_failures",
126
- "cq_ev_queue_trylock_successes",
127
- "cq_ev_queue_transient_pop_failures",
48
+ "http2_transport_stalls",
49
+ "http2_stream_stalls",
50
+ "cq_pluck_creates",
51
+ "cq_next_creates",
52
+ "cq_callback_creates",
128
53
  };
129
54
  const char* grpc_stats_counter_doc[GRPC_STATS_COUNTER_COUNT] = {
130
55
  "Number of client side calls created by this process",
131
56
  "Number of server side calls created by this process",
132
- "Number of completion queues created",
133
57
  "Number of client channels created",
134
58
  "Number of client subchannels created",
135
59
  "Number of server channels created",
136
- "Number of polling syscalls (epoll_wait, poll, etc) made by this process",
137
- "Number of sleeping syscalls made by this process",
138
- "How many polling wakeups were performed by the process (only valid for "
139
- "epoll1 right now)",
140
- "How many times was a polling wakeup requested without an active poller "
141
- "(only valid for epoll1 right now)",
142
- "How many times was the same polling worker awoken repeatedly before "
143
- "waking up (only valid for epoll1 right now)",
144
- "How many times was an eventfd used as the wakeup vector for a polling "
145
- "wakeup (only valid for epoll1 right now)",
146
- "How many times was a condition variable used as the wakeup vector for a "
147
- "polling wakeup (only valid for epoll1 right now)",
148
- "How many times could a polling wakeup be satisfied by keeping the waking "
149
- "thread awake? (only valid for epoll1 right now)",
150
- "Number of times histogram increments went through the slow (binary "
151
- "search) path",
152
60
  "Number of write syscalls (or equivalent - eg sendmsg) made by this "
153
61
  "process",
154
62
  "Number of read syscalls (or equivalent - eg recvmsg) made by this process",
155
- "Number of times a backup poller has been created (this can be expensive)",
156
- "Number of polls performed on the backup poller",
157
- "Number of batches received by HTTP2 transport",
158
- "Number of cancelations received by HTTP2 transport",
159
- "Number of batches containing send initial metadata",
160
- "Number of batches containing send message",
161
- "Number of batches containing send trailing metadata",
162
- "Number of batches containing receive initial metadata",
163
- "Number of batches containing receive message",
164
- "Number of batches containing receive trailing metadata",
63
+ "Number of 8k allocations by the TCP subsystem for reading",
64
+ "Number of 64k allocations by the TCP subsystem for reading",
165
65
  "Number of settings frames sent",
166
66
  "Number of HTTP2 pings sent by process",
167
67
  "Number of HTTP2 writes initiated",
168
- "Number of HTTP2 writes offloaded to the executor from application threads",
169
- "Number of HTTP2 writes that finished seeing more data needed to be "
170
- "written",
171
- "Number of HTTP2 writes that were made knowing there was still more data "
172
- "to be written (we cap maximum write size to syscall_write)",
173
- "Number of HTTP2 writes initiated due to 'initial_write'",
174
- "Number of HTTP2 writes initiated due to 'start_new_stream'",
175
- "Number of HTTP2 writes initiated due to 'send_message'",
176
- "Number of HTTP2 writes initiated due to 'send_initial_metadata'",
177
- "Number of HTTP2 writes initiated due to 'send_trailing_metadata'",
178
- "Number of HTTP2 writes initiated due to 'retry_send_ping'",
179
- "Number of HTTP2 writes initiated due to 'continue_pings'",
180
- "Number of HTTP2 writes initiated due to 'goaway_sent'",
181
- "Number of HTTP2 writes initiated due to 'rst_stream'",
182
- "Number of HTTP2 writes initiated due to 'close_from_api'",
183
- "Number of HTTP2 writes initiated due to 'stream_flow_control'",
184
- "Number of HTTP2 writes initiated due to 'transport_flow_control'",
185
- "Number of HTTP2 writes initiated due to 'send_settings'",
186
- "Number of HTTP2 writes initiated due to 'settings_ack'",
187
- "Number of HTTP2 writes initiated due to 'bdp_estimator_ping'",
188
- "Number of HTTP2 writes initiated due to "
189
- "'flow_control_unstalled_by_setting'",
190
- "Number of HTTP2 writes initiated due to "
191
- "'flow_control_unstalled_by_update'",
192
- "Number of HTTP2 writes initiated due to 'application_ping'",
193
- "Number of HTTP2 writes initiated due to 'keepalive_ping'",
194
- "Number of HTTP2 writes initiated due to "
195
- "'transport_flow_control_unstalled'",
196
- "Number of HTTP2 writes initiated due to 'ping_response'",
197
- "Number of HTTP2 writes initiated due to 'force_rst_stream'",
198
- "Number of HTTP2 writes initiated with nothing to write",
199
- "Number of HPACK indexed fields received",
200
- "Number of HPACK literal headers received with incremental indexing",
201
- "Number of HPACK literal headers received with incremental indexing and "
202
- "literal keys",
203
- "Number of HPACK literal headers received with no indexing",
204
- "Number of HPACK literal headers received with no indexing and literal "
205
- "keys",
206
- "Number of HPACK literal headers received with never-indexing",
207
- "Number of HPACK literal headers received with never-indexing and literal "
208
- "keys",
209
- "Number of uncompressed strings received in metadata",
210
- "Number of huffman encoded strings received in metadata",
211
- "Number of binary strings received in metadata",
212
- "Number of binary strings received encoded in base64 in metadata",
213
- "Number of HPACK indexed fields sent",
214
- "Number of HPACK literal headers sent with incremental indexing",
215
- "Number of HPACK literal headers sent with incremental indexing and "
216
- "literal keys",
217
- "Number of HPACK literal headers sent with no indexing",
218
- "Number of HPACK literal headers sent with no indexing and literal keys",
219
- "Number of HPACK literal headers sent with never-indexing",
220
- "Number of HPACK literal headers sent with never-indexing and literal keys",
221
- "Number of uncompressed strings sent in metadata",
222
- "Number of huffman encoded strings sent in metadata",
223
- "Number of binary strings received in metadata",
224
- "Number of binary strings received encoded in base64 in metadata",
225
- "Number of combiner lock entries by process (first items queued to a "
226
- "combiner)",
227
- "Number of items scheduled against combiner locks",
228
- "Number of final items scheduled against combiner locks",
229
- "Number of combiner locks offloaded to different threads",
230
- "Number of call combiner lock entries by process (first items queued to a "
231
- "call combiner)",
232
- "Number of items scheduled against call combiner locks",
233
- "Number of times a cancellation callback was set on a call combiner",
234
- "Number of times a call combiner was cancelled",
235
- "Number of finite runtime closures scheduled against the executor (gRPC "
236
- "thread pool)",
237
- "Number of potentially infinite runtime closures scheduled against the "
238
- "executor (gRPC thread pool)",
239
- "Number of closures scheduled by the executor to the executor",
240
- "Number of thread wakeups initiated within the executor",
241
- "Number of times an executor queue was drained",
242
- "Number of times we raced and were forced to retry pushing a closure to "
243
- "the executor",
244
- "How many calls were requested (not necessarily received) by the server",
245
- "How many times was the server slow path taken (indicates too few "
246
- "outstanding requests)",
247
- "Number of lock (trylock) acquisition failures on completion queue event "
248
- "queue. High value here indicates high contention on completion queues",
249
- "Number of lock (trylock) acquisition successes on completion queue event "
250
- "queue.",
251
- "Number of times NULL was popped out of completion queue's event queue "
252
- "even though the event queue was not empty",
68
+ "Number of times sending was completely stalled by the transport flow "
69
+ "control window",
70
+ "Number of times sending was completely stalled by the stream flow control "
71
+ "window",
72
+ "Number of completion queues created for cq_pluck (indicates sync api "
73
+ "usage)",
74
+ "Number of completion queues created for cq_next (indicates cq async api "
75
+ "usage)",
76
+ "Number of completion queues created for cq_callback (indicates callback "
77
+ "api usage)",
253
78
  };
254
79
  const char* grpc_stats_histogram_name[GRPC_STATS_HISTOGRAM_COUNT] = {
255
- "call_initial_size",
256
- "poll_events_returned",
257
- "tcp_write_size",
258
- "tcp_write_iov_size",
259
- "tcp_read_size",
260
- "tcp_read_offer",
261
- "tcp_read_offer_iov_size",
80
+ "call_initial_size", "tcp_write_size", "tcp_write_iov_size",
81
+ "tcp_read_size", "tcp_read_offer", "tcp_read_offer_iov_size",
262
82
  "http2_send_message_size",
263
- "http2_send_initial_metadata_per_write",
264
- "http2_send_message_per_write",
265
- "http2_send_trailing_metadata_per_write",
266
- "http2_send_flowctl_per_write",
267
- "server_cqs_checked",
268
83
  };
269
84
  const char* grpc_stats_histogram_doc[GRPC_STATS_HISTOGRAM_COUNT] = {
270
85
  "Initial size of the grpc_call arena created at call start",
271
- "How many events are called for each syscall_poll",
272
86
  "Number of bytes offered to each syscall_write",
273
87
  "Number of byte segments offered to each syscall_write",
274
88
  "Number of bytes received by each syscall_read",
275
89
  "Number of bytes offered to each syscall_read",
276
90
  "Number of byte segments offered to each syscall_read",
277
91
  "Size of messages received by HTTP2 transport",
278
- "Number of streams initiated written per TCP write",
279
- "Number of streams whose payload was written per TCP write",
280
- "Number of streams terminated per TCP write",
281
- "Number of flow control updates written per TCP write",
282
- "How many completion queues were checked looking for a CQ that had "
283
- "requested the incoming call",
284
92
  };
285
- const int grpc_stats_table_0[65] = {
286
- 0, 1, 2, 3, 4, 5, 7, 9, 11, 14,
287
- 17, 21, 26, 32, 39, 47, 57, 68, 82, 98,
288
- 117, 140, 167, 199, 238, 284, 339, 404, 482, 575,
289
- 685, 816, 972, 1158, 1380, 1644, 1959, 2334, 2780, 3312,
290
- 3945, 4699, 5597, 6667, 7941, 9459, 11267, 13420, 15984, 19038,
291
- 22676, 27009, 32169, 38315, 45635, 54353, 64737, 77104, 91834, 109378,
292
- 130273, 155159, 184799, 220100, 262144};
293
- const uint8_t grpc_stats_table_1[124] = {
294
- 0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6,
295
- 7, 7, 7, 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15,
296
- 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 22, 23, 24,
297
- 24, 25, 25, 26, 26, 26, 27, 27, 28, 29, 29, 30, 30, 30, 31, 31, 32, 33,
298
- 33, 34, 34, 34, 35, 35, 36, 37, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41,
299
- 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50,
300
- 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57, 58, 58};
301
- const int grpc_stats_table_2[129] = {
302
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
303
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30,
304
- 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60,
305
- 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 94, 98, 102, 106, 110,
306
- 114, 118, 122, 126, 131, 136, 141, 146, 151, 156, 162, 168, 174, 180, 186,
307
- 192, 199, 206, 213, 220, 228, 236, 244, 252, 260, 269, 278, 287, 297, 307,
308
- 317, 327, 338, 349, 360, 372, 384, 396, 409, 422, 436, 450, 464, 479, 494,
309
- 510, 526, 543, 560, 578, 596, 615, 634, 654, 674, 695, 717, 739, 762, 785,
310
- 809, 834, 859, 885, 912, 939, 967, 996, 1024};
311
- const uint8_t grpc_stats_table_3[166] = {
312
- 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7,
313
- 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 16,
314
- 17, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 25, 25, 26, 26, 27, 27, 28,
315
- 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 36, 36, 37, 38, 39,
316
- 40, 40, 41, 42, 42, 43, 44, 44, 45, 46, 46, 47, 48, 48, 49, 49, 50, 50, 51,
317
- 51, 52, 52, 53, 53, 54, 54, 55, 56, 57, 58, 59, 59, 60, 61, 62, 63, 63, 64,
318
- 65, 65, 66, 67, 67, 68, 69, 69, 70, 71, 71, 72, 72, 73, 73, 74, 75, 75, 76,
319
- 76, 77, 78, 79, 79, 80, 81, 82, 83, 84, 85, 85, 86, 87, 88, 88, 89, 90, 90,
320
- 91, 92, 92, 93, 94, 94, 95, 95, 96, 97, 97, 98, 98, 99};
321
- const int grpc_stats_table_4[65] = {
322
- 0, 1, 2, 3, 4, 6, 8, 11,
323
- 15, 20, 26, 34, 44, 57, 73, 94,
324
- 121, 155, 199, 255, 327, 419, 537, 688,
325
- 881, 1128, 1444, 1848, 2365, 3026, 3872, 4954,
326
- 6338, 8108, 10373, 13270, 16976, 21717, 27782, 35541,
327
- 45467, 58165, 74409, 95189, 121772, 155778, 199281, 254933,
328
- 326126, 417200, 533707, 682750, 873414, 1117323, 1429345, 1828502,
329
- 2339127, 2992348, 3827987, 4896985, 6264509, 8013925, 10251880, 13114801,
330
- 16777216};
331
- const uint8_t grpc_stats_table_5[87] = {
332
- 0, 0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 11,
333
- 11, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 19, 20, 20, 21, 22, 22, 23,
334
- 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 34, 34, 35, 36,
335
- 36, 37, 38, 39, 39, 40, 41, 41, 42, 43, 44, 44, 45, 45, 46, 47, 48, 48,
336
- 49, 50, 51, 51, 52, 53, 53, 54, 55, 56, 56, 57, 58, 58, 59};
337
- const int grpc_stats_table_6[65] = {
338
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
339
- 14, 16, 18, 20, 22, 24, 27, 30, 33, 36, 39, 43, 47,
340
- 51, 56, 61, 66, 72, 78, 85, 92, 100, 109, 118, 128, 139,
341
- 151, 164, 178, 193, 209, 226, 244, 264, 285, 308, 333, 359, 387,
342
- 418, 451, 486, 524, 565, 609, 656, 707, 762, 821, 884, 952, 1024};
343
- const uint8_t grpc_stats_table_7[102] = {
344
- 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
345
- 6, 7, 7, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 13, 14, 14,
346
- 14, 15, 15, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23,
347
- 23, 24, 24, 24, 25, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32,
348
- 32, 33, 33, 34, 35, 35, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41,
349
- 42, 42, 43, 44, 44, 45, 46, 46, 47, 48, 48, 49, 49, 50, 50, 51, 51};
350
- const int grpc_stats_table_8[9] = {0, 1, 2, 4, 7, 13, 23, 39, 64};
351
- const uint8_t grpc_stats_table_9[9] = {0, 0, 1, 2, 2, 3, 4, 4, 5};
352
- void grpc_stats_inc_call_initial_size(int value) {
353
- value = grpc_core::Clamp(value, 0, 262144);
354
- if (value < 6) {
355
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_CALL_INITIAL_SIZE, value);
356
- return;
357
- }
358
- union {
359
- double dbl;
360
- uint64_t uint;
361
- } _val, _bkt;
362
- _val.dbl = value;
363
- if (_val.uint < 4651092515166879744ull) {
364
- int bucket =
365
- grpc_stats_table_1[((_val.uint - 4618441417868443648ull) >> 49)] + 6;
366
- _bkt.dbl = grpc_stats_table_0[bucket];
367
- bucket -= (_val.uint < _bkt.uint);
368
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_CALL_INITIAL_SIZE, bucket);
369
- return;
370
- }
371
- GRPC_STATS_INC_HISTOGRAM(
372
- GRPC_STATS_HISTOGRAM_CALL_INITIAL_SIZE,
373
- grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_0, 64));
374
- }
375
- void grpc_stats_inc_poll_events_returned(int value) {
376
- value = grpc_core::Clamp(value, 0, 1024);
377
- if (value < 29) {
378
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_POLL_EVENTS_RETURNED, value);
379
- return;
380
- }
381
- union {
382
- double dbl;
383
- uint64_t uint;
384
- } _val, _bkt;
385
- _val.dbl = value;
386
- if (_val.uint < 4642789003353915392ull) {
387
- int bucket =
388
- grpc_stats_table_3[((_val.uint - 4628855992006737920ull) >> 47)] + 29;
389
- _bkt.dbl = grpc_stats_table_2[bucket];
390
- bucket -= (_val.uint < _bkt.uint);
391
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_POLL_EVENTS_RETURNED, bucket);
392
- return;
393
- }
394
- GRPC_STATS_INC_HISTOGRAM(
395
- GRPC_STATS_HISTOGRAM_POLL_EVENTS_RETURNED,
396
- grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_2, 128));
397
- }
398
- void grpc_stats_inc_tcp_write_size(int value) {
399
- value = grpc_core::Clamp(value, 0, 16777216);
400
- if (value < 5) {
401
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE, value);
402
- return;
403
- }
404
- union {
405
- double dbl;
406
- uint64_t uint;
407
- } _val, _bkt;
408
- _val.dbl = value;
409
- if (_val.uint < 4683743612465315840ull) {
410
- int bucket =
411
- grpc_stats_table_5[((_val.uint - 4617315517961601024ull) >> 50)] + 5;
412
- _bkt.dbl = grpc_stats_table_4[bucket];
413
- bucket -= (_val.uint < _bkt.uint);
414
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE, bucket);
415
- return;
416
- }
417
- GRPC_STATS_INC_HISTOGRAM(
418
- GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE,
419
- grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_4, 64));
420
- }
421
- void grpc_stats_inc_tcp_write_iov_size(int value) {
422
- value = grpc_core::Clamp(value, 0, 1024);
423
- if (value < 13) {
424
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE, value);
425
- return;
426
- }
427
- union {
428
- double dbl;
429
- uint64_t uint;
430
- } _val, _bkt;
431
- _val.dbl = value;
432
- if (_val.uint < 4637863191261478912ull) {
433
- int bucket =
434
- grpc_stats_table_7[((_val.uint - 4623507967449235456ull) >> 48)] + 13;
435
- _bkt.dbl = grpc_stats_table_6[bucket];
436
- bucket -= (_val.uint < _bkt.uint);
437
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE, bucket);
438
- return;
439
- }
440
- GRPC_STATS_INC_HISTOGRAM(
441
- GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE,
442
- grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
443
- }
444
- void grpc_stats_inc_tcp_read_size(int value) {
445
- value = grpc_core::Clamp(value, 0, 16777216);
446
- if (value < 5) {
447
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_READ_SIZE, value);
448
- return;
449
- }
450
- union {
451
- double dbl;
452
- uint64_t uint;
453
- } _val, _bkt;
454
- _val.dbl = value;
455
- if (_val.uint < 4683743612465315840ull) {
456
- int bucket =
457
- grpc_stats_table_5[((_val.uint - 4617315517961601024ull) >> 50)] + 5;
458
- _bkt.dbl = grpc_stats_table_4[bucket];
459
- bucket -= (_val.uint < _bkt.uint);
460
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_READ_SIZE, bucket);
461
- return;
462
- }
463
- GRPC_STATS_INC_HISTOGRAM(
464
- GRPC_STATS_HISTOGRAM_TCP_READ_SIZE,
465
- grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_4, 64));
466
- }
467
- void grpc_stats_inc_tcp_read_offer(int value) {
468
- value = grpc_core::Clamp(value, 0, 16777216);
469
- if (value < 5) {
470
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_READ_OFFER, value);
471
- return;
472
- }
473
- union {
474
- double dbl;
475
- uint64_t uint;
476
- } _val, _bkt;
477
- _val.dbl = value;
478
- if (_val.uint < 4683743612465315840ull) {
479
- int bucket =
480
- grpc_stats_table_5[((_val.uint - 4617315517961601024ull) >> 50)] + 5;
481
- _bkt.dbl = grpc_stats_table_4[bucket];
482
- bucket -= (_val.uint < _bkt.uint);
483
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_READ_OFFER, bucket);
484
- return;
485
- }
486
- GRPC_STATS_INC_HISTOGRAM(
487
- GRPC_STATS_HISTOGRAM_TCP_READ_OFFER,
488
- grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_4, 64));
489
- }
490
- void grpc_stats_inc_tcp_read_offer_iov_size(int value) {
491
- value = grpc_core::Clamp(value, 0, 1024);
492
- if (value < 13) {
493
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_READ_OFFER_IOV_SIZE,
494
- value);
495
- return;
496
- }
497
- union {
498
- double dbl;
499
- uint64_t uint;
500
- } _val, _bkt;
501
- _val.dbl = value;
502
- if (_val.uint < 4637863191261478912ull) {
503
- int bucket =
504
- grpc_stats_table_7[((_val.uint - 4623507967449235456ull) >> 48)] + 13;
505
- _bkt.dbl = grpc_stats_table_6[bucket];
506
- bucket -= (_val.uint < _bkt.uint);
507
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_READ_OFFER_IOV_SIZE,
508
- bucket);
509
- return;
510
- }
511
- GRPC_STATS_INC_HISTOGRAM(
512
- GRPC_STATS_HISTOGRAM_TCP_READ_OFFER_IOV_SIZE,
513
- grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
514
- }
515
- void grpc_stats_inc_http2_send_message_size(int value) {
516
- value = grpc_core::Clamp(value, 0, 16777216);
517
- if (value < 5) {
518
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_SIZE,
519
- value);
520
- return;
521
- }
522
- union {
523
- double dbl;
524
- uint64_t uint;
525
- } _val, _bkt;
526
- _val.dbl = value;
527
- if (_val.uint < 4683743612465315840ull) {
528
- int bucket =
529
- grpc_stats_table_5[((_val.uint - 4617315517961601024ull) >> 50)] + 5;
530
- _bkt.dbl = grpc_stats_table_4[bucket];
531
- bucket -= (_val.uint < _bkt.uint);
532
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_SIZE,
533
- bucket);
534
- return;
535
- }
536
- GRPC_STATS_INC_HISTOGRAM(
537
- GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_SIZE,
538
- grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_4, 64));
539
- }
540
- void grpc_stats_inc_http2_send_initial_metadata_per_write(int value) {
541
- value = grpc_core::Clamp(value, 0, 1024);
542
- if (value < 13) {
543
- GRPC_STATS_INC_HISTOGRAM(
544
- GRPC_STATS_HISTOGRAM_HTTP2_SEND_INITIAL_METADATA_PER_WRITE, value);
545
- return;
546
- }
547
- union {
548
- double dbl;
549
- uint64_t uint;
550
- } _val, _bkt;
551
- _val.dbl = value;
552
- if (_val.uint < 4637863191261478912ull) {
553
- int bucket =
554
- grpc_stats_table_7[((_val.uint - 4623507967449235456ull) >> 48)] + 13;
555
- _bkt.dbl = grpc_stats_table_6[bucket];
556
- bucket -= (_val.uint < _bkt.uint);
557
- GRPC_STATS_INC_HISTOGRAM(
558
- GRPC_STATS_HISTOGRAM_HTTP2_SEND_INITIAL_METADATA_PER_WRITE, bucket);
559
- return;
560
- }
561
- GRPC_STATS_INC_HISTOGRAM(
562
- GRPC_STATS_HISTOGRAM_HTTP2_SEND_INITIAL_METADATA_PER_WRITE,
563
- grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
564
- }
565
- void grpc_stats_inc_http2_send_message_per_write(int value) {
566
- value = grpc_core::Clamp(value, 0, 1024);
567
- if (value < 13) {
568
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_PER_WRITE,
569
- value);
570
- return;
571
- }
572
- union {
573
- double dbl;
574
- uint64_t uint;
575
- } _val, _bkt;
576
- _val.dbl = value;
577
- if (_val.uint < 4637863191261478912ull) {
578
- int bucket =
579
- grpc_stats_table_7[((_val.uint - 4623507967449235456ull) >> 48)] + 13;
580
- _bkt.dbl = grpc_stats_table_6[bucket];
581
- bucket -= (_val.uint < _bkt.uint);
582
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_PER_WRITE,
583
- bucket);
584
- return;
585
- }
586
- GRPC_STATS_INC_HISTOGRAM(
587
- GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_PER_WRITE,
588
- grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
589
- }
590
- void grpc_stats_inc_http2_send_trailing_metadata_per_write(int value) {
591
- value = grpc_core::Clamp(value, 0, 1024);
592
- if (value < 13) {
593
- GRPC_STATS_INC_HISTOGRAM(
594
- GRPC_STATS_HISTOGRAM_HTTP2_SEND_TRAILING_METADATA_PER_WRITE, value);
595
- return;
596
- }
597
- union {
598
- double dbl;
599
- uint64_t uint;
600
- } _val, _bkt;
601
- _val.dbl = value;
602
- if (_val.uint < 4637863191261478912ull) {
603
- int bucket =
604
- grpc_stats_table_7[((_val.uint - 4623507967449235456ull) >> 48)] + 13;
605
- _bkt.dbl = grpc_stats_table_6[bucket];
606
- bucket -= (_val.uint < _bkt.uint);
607
- GRPC_STATS_INC_HISTOGRAM(
608
- GRPC_STATS_HISTOGRAM_HTTP2_SEND_TRAILING_METADATA_PER_WRITE, bucket);
609
- return;
93
+ const int grpc_stats_table_0[25] = {
94
+ 0, 1, 2, 4, 7, 11, 17, 26, 40, 61, 93, 142, 216,
95
+ 329, 500, 760, 1155, 1755, 2667, 4052, 6155, 9350, 14203, 21574, 32768};
96
+ const uint8_t grpc_stats_table_1[27] = {3, 3, 4, 5, 6, 6, 7, 8, 9,
97
+ 10, 11, 11, 12, 13, 14, 15, 16, 16,
98
+ 17, 18, 19, 20, 20, 21, 22, 23, 24};
99
+ const int grpc_stats_table_2[21] = {
100
+ 0, 1, 3, 8, 19, 45, 106,
101
+ 250, 588, 1383, 3252, 7646, 17976, 42262,
102
+ 99359, 233593, 549177, 1291113, 3035402, 7136218, 16777216};
103
+ const uint8_t grpc_stats_table_3[23] = {2, 3, 3, 4, 5, 6, 7, 8,
104
+ 8, 9, 10, 11, 12, 12, 13, 14,
105
+ 15, 16, 16, 17, 18, 19, 20};
106
+ const int grpc_stats_table_4[11] = {0, 1, 2, 4, 7, 11, 17, 26, 38, 56, 80};
107
+ const uint8_t grpc_stats_table_5[9] = {3, 3, 4, 5, 6, 6, 7, 8, 9};
108
+ namespace grpc_core {
109
+ int BucketForHistogramValue_32768_24(int value) {
110
+ if (value < 3) {
111
+ if (value < 0) {
112
+ return 0;
113
+ } else {
114
+ return value;
115
+ }
116
+ } else {
117
+ if (value < 24577) {
118
+ // first_nontrivial_code=4613937818241073152
119
+ // last_code=4672484613396889600 [24576.000000]
120
+ DblUint val;
121
+ val.dbl = value;
122
+ const int bucket =
123
+ grpc_stats_table_1[((val.uint - 4613937818241073152ull) >> 51)];
124
+ return bucket - (value < grpc_stats_table_0[bucket]);
125
+ } else {
126
+ return 23;
127
+ }
610
128
  }
611
- GRPC_STATS_INC_HISTOGRAM(
612
- GRPC_STATS_HISTOGRAM_HTTP2_SEND_TRAILING_METADATA_PER_WRITE,
613
- grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
614
129
  }
615
- void grpc_stats_inc_http2_send_flowctl_per_write(int value) {
616
- value = grpc_core::Clamp(value, 0, 1024);
617
- if (value < 13) {
618
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_HTTP2_SEND_FLOWCTL_PER_WRITE,
619
- value);
620
- return;
130
+ int BucketForHistogramValue_16777216_20(int value) {
131
+ if (value < 2) {
132
+ if (value < 0) {
133
+ return 0;
134
+ } else {
135
+ return value;
136
+ }
137
+ } else {
138
+ if (value < 8388609) {
139
+ // first_nontrivial_code=4611686018427387904
140
+ // last_code=4710765210229538816 [8388608.000000]
141
+ DblUint val;
142
+ val.dbl = value;
143
+ const int bucket =
144
+ grpc_stats_table_3[((val.uint - 4611686018427387904ull) >> 52)];
145
+ return bucket - (value < grpc_stats_table_2[bucket]);
146
+ } else {
147
+ return 19;
148
+ }
621
149
  }
622
- union {
623
- double dbl;
624
- uint64_t uint;
625
- } _val, _bkt;
626
- _val.dbl = value;
627
- if (_val.uint < 4637863191261478912ull) {
628
- int bucket =
629
- grpc_stats_table_7[((_val.uint - 4623507967449235456ull) >> 48)] + 13;
630
- _bkt.dbl = grpc_stats_table_6[bucket];
631
- bucket -= (_val.uint < _bkt.uint);
632
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_HTTP2_SEND_FLOWCTL_PER_WRITE,
633
- bucket);
634
- return;
635
- }
636
- GRPC_STATS_INC_HISTOGRAM(
637
- GRPC_STATS_HISTOGRAM_HTTP2_SEND_FLOWCTL_PER_WRITE,
638
- grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
639
150
  }
640
- void grpc_stats_inc_server_cqs_checked(int value) {
641
- value = grpc_core::Clamp(value, 0, 64);
151
+ int BucketForHistogramValue_80_10(int value) {
642
152
  if (value < 3) {
643
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_SERVER_CQS_CHECKED, value);
644
- return;
645
- }
646
- union {
647
- double dbl;
648
- uint64_t uint;
649
- } _val, _bkt;
650
- _val.dbl = value;
651
- if (_val.uint < 4625196817309499392ull) {
652
- int bucket =
653
- grpc_stats_table_9[((_val.uint - 4613937818241073152ull) >> 51)] + 3;
654
- _bkt.dbl = grpc_stats_table_8[bucket];
655
- bucket -= (_val.uint < _bkt.uint);
656
- GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_SERVER_CQS_CHECKED, bucket);
657
- return;
153
+ if (value < 0) {
154
+ return 0;
155
+ } else {
156
+ return value;
157
+ }
158
+ } else {
159
+ if (value < 49) {
160
+ // first_nontrivial_code=4613937818241073152
161
+ // last_code=4631952216750555136 [48.000000]
162
+ DblUint val;
163
+ val.dbl = value;
164
+ const int bucket =
165
+ grpc_stats_table_5[((val.uint - 4613937818241073152ull) >> 51)];
166
+ return bucket - (value < grpc_stats_table_4[bucket]);
167
+ } else {
168
+ if (value < 56) {
169
+ return 8;
170
+ } else {
171
+ return 9;
172
+ }
173
+ }
658
174
  }
659
- GRPC_STATS_INC_HISTOGRAM(
660
- GRPC_STATS_HISTOGRAM_SERVER_CQS_CHECKED,
661
- grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_8, 8));
662
175
  }
663
- const int grpc_stats_histo_buckets[13] = {64, 128, 64, 64, 64, 64, 64,
664
- 64, 64, 64, 64, 64, 8};
665
- const int grpc_stats_histo_start[13] = {0, 64, 192, 256, 320, 384, 448,
666
- 512, 576, 640, 704, 768, 832};
667
- const int* const grpc_stats_histo_bucket_boundaries[13] = {
176
+ } // namespace grpc_core
177
+ const int grpc_stats_histo_buckets[7] = {24, 20, 10, 20, 20, 10, 20};
178
+ const int grpc_stats_histo_start[7] = {0, 24, 44, 54, 74, 94, 104};
179
+ const int* const grpc_stats_histo_bucket_boundaries[7] = {
668
180
  grpc_stats_table_0, grpc_stats_table_2, grpc_stats_table_4,
669
- grpc_stats_table_6, grpc_stats_table_4, grpc_stats_table_4,
670
- grpc_stats_table_6, grpc_stats_table_4, grpc_stats_table_6,
671
- grpc_stats_table_6, grpc_stats_table_6, grpc_stats_table_6,
672
- grpc_stats_table_8};
673
- void (*const grpc_stats_inc_histogram[13])(int x) = {
674
- grpc_stats_inc_call_initial_size,
675
- grpc_stats_inc_poll_events_returned,
676
- grpc_stats_inc_tcp_write_size,
677
- grpc_stats_inc_tcp_write_iov_size,
678
- grpc_stats_inc_tcp_read_size,
679
- grpc_stats_inc_tcp_read_offer,
680
- grpc_stats_inc_tcp_read_offer_iov_size,
681
- grpc_stats_inc_http2_send_message_size,
682
- grpc_stats_inc_http2_send_initial_metadata_per_write,
683
- grpc_stats_inc_http2_send_message_per_write,
684
- grpc_stats_inc_http2_send_trailing_metadata_per_write,
685
- grpc_stats_inc_http2_send_flowctl_per_write,
686
- grpc_stats_inc_server_cqs_checked};
181
+ grpc_stats_table_2, grpc_stats_table_2, grpc_stats_table_4,
182
+ grpc_stats_table_2};
183
+ int (*const grpc_stats_get_bucket[7])(int value) = {
184
+ grpc_core::BucketForHistogramValue_32768_24,
185
+ grpc_core::BucketForHistogramValue_16777216_20,
186
+ grpc_core::BucketForHistogramValue_80_10,
187
+ grpc_core::BucketForHistogramValue_16777216_20,
188
+ grpc_core::BucketForHistogramValue_16777216_20,
189
+ grpc_core::BucketForHistogramValue_80_10,
190
+ grpc_core::BucketForHistogramValue_16777216_20};