Merge github.com:grpc/grpc into cleaner-posix3

pull/5647/head
Craig Tiller 9 years ago
commit 0d2a0ae7c5
  1. 114
      BUILD
  2. 245
      Makefile
  3. 22
      binding.gyp
  4. 81
      build.yaml
  5. 27
      config.m4
  6. 52
      gRPC.podspec
  7. 37
      grpc.gemspec
  8. 37
      package.json
  9. 37
      package.xml
  10. 0
      src/core/ext/census/README.md
  11. 6
      src/core/ext/census/aggregation.h
  12. 6
      src/core/ext/census/census_init.c
  13. 6
      src/core/ext/census/census_interface.h
  14. 2
      src/core/ext/census/census_log.c
  15. 6
      src/core/ext/census/census_log.h
  16. 10
      src/core/ext/census/census_rpc_stats.c
  17. 8
      src/core/ext/census/census_rpc_stats.h
  18. 6
      src/core/ext/census/census_tracing.c
  19. 8
      src/core/ext/census/census_tracing.h
  20. 0
      src/core/ext/census/context.c
  21. 0
      src/core/ext/census/grpc_context.c
  22. 6
      src/core/ext/census/grpc_filter.c
  23. 6
      src/core/ext/census/grpc_filter.h
  24. 6
      src/core/ext/census/grpc_plugin.c
  25. 2
      src/core/ext/census/hash_table.c
  26. 6
      src/core/ext/census/hash_table.h
  27. 0
      src/core/ext/census/initialize.c
  28. 2
      src/core/ext/census/mlog.c
  29. 6
      src/core/ext/census/mlog.h
  30. 0
      src/core/ext/census/operation.c
  31. 0
      src/core/ext/census/placeholders.c
  32. 6
      src/core/ext/census/rpc_metric_id.h
  33. 0
      src/core/ext/census/tracing.c
  34. 2
      src/core/ext/census/window_stats.c
  35. 6
      src/core/ext/census/window_stats.h
  36. 2
      src/core/ext/resolver/dns/native/README.md
  37. 15
      src/core/ext/resolver/dns/native/dns_resolver.c
  38. 1
      src/core/ext/resolver/sockaddr/README.md
  39. 23
      src/core/ext/resolver/sockaddr/sockaddr_resolver.c
  40. 1
      src/core/ext/resolver/zookeeper/README.md
  41. 22
      src/core/ext/resolver/zookeeper/zookeeper_resolver.c
  42. 2
      src/core/ext/transport/chttp2/client/insecure/channel_create.c
  43. 22
      src/core/lib/client_config/resolver_registry.c
  44. 4
      src/core/lib/client_config/resolver_registry.h
  45. 42
      src/core/lib/client_config/resolvers/zookeeper_resolver.h
  46. 68
      src/core/lib/client_config/uri_parser.c
  47. 12
      src/core/lib/client_config/uri_parser.h
  48. 3
      src/core/lib/iomgr/tcp_client_windows.c
  49. 11
      src/core/lib/json/json_reader.c
  50. 12
      src/core/lib/surface/init.c
  51. 12
      src/core/plugin_registry/grpc_plugin_registry.c
  52. 12
      src/core/plugin_registry/grpc_unsecure_plugin_registry.c
  53. 4
      src/csharp/.nuget/packages.config
  54. 51
      src/csharp/Grpc.Auth/Grpc.Auth.csproj
  55. 2
      src/csharp/Grpc.Auth/Grpc.Auth.nuspec
  56. 19
      src/csharp/Grpc.Auth/app.config
  57. 8
      src/csharp/Grpc.Auth/packages.config
  58. 1
      src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj
  59. 97
      src/csharp/Grpc.Core.Tests/HalfcloseTest.cs
  60. 6
      src/csharp/Grpc.Core.Tests/PInvokeTest.cs
  61. 14
      src/csharp/Grpc.Core/Internal/AsyncCall.cs
  62. 38
      src/csharp/Grpc.Core/Internal/AsyncCallBase.cs
  63. 6
      src/csharp/Grpc.Core/Internal/AsyncCallServer.cs
  64. 39
      src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj
  65. 19
      src/csharp/Grpc.IntegrationTesting.Client/app.config
  66. 8
      src/csharp/Grpc.IntegrationTesting.Client/packages.config
  67. 4
      src/csharp/Grpc.IntegrationTesting.QpsWorker/app.config
  68. 39
      src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj
  69. 19
      src/csharp/Grpc.IntegrationTesting.Server/app.config
  70. 8
      src/csharp/Grpc.IntegrationTesting.Server/packages.config
  71. 49
      src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
  72. 19
      src/csharp/Grpc.IntegrationTesting/app.config
  73. 8
      src/csharp/Grpc.IntegrationTesting/packages.config
  74. 1
      src/csharp/tests.json
  75. 2
      src/node/interop/interop_client.js
  76. 39
      src/node/stress/metrics_client.js
  77. 59
      src/node/stress/metrics_server.js
  78. 126
      src/node/stress/stress_client.js
  79. 11
      src/python/grpcio/grpc/beta/implementations.py
  80. 22
      src/python/grpcio/grpc_core_dependencies.py
  81. 4
      src/python/grpcio/tests/interop/_secure_interop_test.py
  82. 4
      src/python/grpcio/tests/interop/client.py
  83. 6
      src/python/grpcio/tests/unit/beta/_beta_features_test.py
  84. 4
      src/python/grpcio/tests/unit/beta/_face_interface_test.py
  85. 5
      src/python/grpcio/tests/unit/beta/_implementations_test.py
  86. 9
      src/ruby/pb/generate_proto_ruby.sh
  87. 164
      src/ruby/qps/client.rb
  88. 88
      src/ruby/qps/histogram.rb
  89. 76
      src/ruby/qps/qps-common.rb
  90. 91
      src/ruby/qps/server.rb
  91. 129
      src/ruby/qps/src/proto/grpc/testing/control.rb
  92. 80
      src/ruby/qps/src/proto/grpc/testing/messages.rb
  93. 33
      src/ruby/qps/src/proto/grpc/testing/payloads.rb
  94. 14
      src/ruby/qps/src/proto/grpc/testing/services.rb
  95. 46
      src/ruby/qps/src/proto/grpc/testing/services_services.rb
  96. 39
      src/ruby/qps/src/proto/grpc/testing/stats.rb
  97. 128
      src/ruby/qps/worker.rb
  98. 2
      test/core/census/mlog_test.c
  99. 5
      test/core/client_config/resolvers/dns_resolver_connectivity_test.c
  100. 8
      test/core/client_config/resolvers/dns_resolver_test.c
  101. Some files were not shown because too many files have changed in this diff Show More

114
BUILD

@ -159,6 +159,12 @@ cc_library(
cc_library(
name = "grpc",
srcs = [
"src/core/ext/census/aggregation.h",
"src/core/ext/census/census_interface.h",
"src/core/ext/census/census_rpc_stats.h",
"src/core/ext/census/grpc_filter.h",
"src/core/ext/census/mlog.h",
"src/core/ext/census/rpc_metric_id.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h",
"src/core/ext/transport/chttp2/transport/alpn.h",
@ -182,11 +188,6 @@ cc_library(
"src/core/ext/transport/chttp2/transport/stream_map.h",
"src/core/ext/transport/chttp2/transport/timeout_encoding.h",
"src/core/ext/transport/chttp2/transport/varint.h",
"src/core/lib/census/aggregation.h",
"src/core/lib/census/grpc_filter.h",
"src/core/lib/census/grpc_plugin.h",
"src/core/lib/census/mlog.h",
"src/core/lib/census/rpc_metric_id.h",
"src/core/lib/channel/channel_args.h",
"src/core/lib/channel/channel_stack.h",
"src/core/lib/channel/channel_stack_builder.h",
@ -206,8 +207,6 @@ cc_library(
"src/core/lib/client_config/resolver.h",
"src/core/lib/client_config/resolver_factory.h",
"src/core/lib/client_config/resolver_registry.h",
"src/core/lib/client_config/resolvers/dns_resolver.h",
"src/core/lib/client_config/resolvers/sockaddr_resolver.h",
"src/core/lib/client_config/subchannel.h",
"src/core/lib/client_config/subchannel_factory.h",
"src/core/lib/client_config/subchannel_index.h",
@ -268,8 +267,6 @@ cc_library(
"src/core/lib/security/secure_endpoint.h",
"src/core/lib/security/security_connector.h",
"src/core/lib/security/security_context.h",
"src/core/lib/statistics/census_interface.h",
"src/core/lib/statistics/census_rpc_stats.h",
"src/core/lib/surface/api_trace.h",
"src/core/lib/surface/call.h",
"src/core/lib/surface/call_test_only.h",
@ -294,10 +291,21 @@ cc_library(
"src/core/lib/tsi/ssl_types.h",
"src/core/lib/tsi/transport_security.h",
"src/core/lib/tsi/transport_security_interface.h",
"src/core/ext/census/context.c",
"src/core/ext/census/grpc_context.c",
"src/core/ext/census/grpc_filter.c",
"src/core/ext/census/grpc_plugin.c",
"src/core/ext/census/initialize.c",
"src/core/ext/census/mlog.c",
"src/core/ext/census/operation.c",
"src/core/ext/census/placeholders.c",
"src/core/ext/census/tracing.c",
"src/core/ext/lb_policy/grpclb/load_balancer_api.c",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c",
"src/core/ext/lb_policy/pick_first/pick_first.c",
"src/core/ext/lb_policy/round_robin/round_robin.c",
"src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create.c",
"src/core/ext/transport/chttp2/client/secure/secure_channel_create.c",
"src/core/ext/transport/chttp2/server/insecure/server_chttp2.c",
@ -323,15 +331,6 @@ cc_library(
"src/core/ext/transport/chttp2/transport/timeout_encoding.c",
"src/core/ext/transport/chttp2/transport/varint.c",
"src/core/ext/transport/chttp2/transport/writing.c",
"src/core/lib/census/context.c",
"src/core/lib/census/grpc_context.c",
"src/core/lib/census/grpc_filter.c",
"src/core/lib/census/grpc_plugin.c",
"src/core/lib/census/initialize.c",
"src/core/lib/census/mlog.c",
"src/core/lib/census/operation.c",
"src/core/lib/census/placeholders.c",
"src/core/lib/census/tracing.c",
"src/core/lib/channel/channel_args.c",
"src/core/lib/channel/channel_stack.c",
"src/core/lib/channel/channel_stack_builder.c",
@ -351,8 +350,6 @@ cc_library(
"src/core/lib/client_config/resolver.c",
"src/core/lib/client_config/resolver_factory.c",
"src/core/lib/client_config/resolver_registry.c",
"src/core/lib/client_config/resolvers/dns_resolver.c",
"src/core/lib/client_config/resolvers/sockaddr_resolver.c",
"src/core/lib/client_config/subchannel.c",
"src/core/lib/client_config/subchannel_factory.c",
"src/core/lib/client_config/subchannel_index.c",
@ -527,6 +524,12 @@ cc_library(
cc_library(
name = "grpc_unsecure",
srcs = [
"src/core/ext/census/aggregation.h",
"src/core/ext/census/census_interface.h",
"src/core/ext/census/census_rpc_stats.h",
"src/core/ext/census/grpc_filter.h",
"src/core/ext/census/mlog.h",
"src/core/ext/census/rpc_metric_id.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h",
"src/core/ext/transport/chttp2/transport/alpn.h",
@ -550,11 +553,6 @@ cc_library(
"src/core/ext/transport/chttp2/transport/stream_map.h",
"src/core/ext/transport/chttp2/transport/timeout_encoding.h",
"src/core/ext/transport/chttp2/transport/varint.h",
"src/core/lib/census/aggregation.h",
"src/core/lib/census/grpc_filter.h",
"src/core/lib/census/grpc_plugin.h",
"src/core/lib/census/mlog.h",
"src/core/lib/census/rpc_metric_id.h",
"src/core/lib/channel/channel_args.h",
"src/core/lib/channel/channel_stack.h",
"src/core/lib/channel/channel_stack_builder.h",
@ -574,8 +572,6 @@ cc_library(
"src/core/lib/client_config/resolver.h",
"src/core/lib/client_config/resolver_factory.h",
"src/core/lib/client_config/resolver_registry.h",
"src/core/lib/client_config/resolvers/dns_resolver.h",
"src/core/lib/client_config/resolvers/sockaddr_resolver.h",
"src/core/lib/client_config/subchannel.h",
"src/core/lib/client_config/subchannel_factory.h",
"src/core/lib/client_config/subchannel_index.h",
@ -627,8 +623,6 @@ cc_library(
"src/core/lib/json/json_common.h",
"src/core/lib/json/json_reader.h",
"src/core/lib/json/json_writer.h",
"src/core/lib/statistics/census_interface.h",
"src/core/lib/statistics/census_rpc_stats.h",
"src/core/lib/surface/api_trace.h",
"src/core/lib/surface/call.h",
"src/core/lib/surface/call_test_only.h",
@ -648,10 +642,21 @@ cc_library(
"src/core/lib/transport/static_metadata.h",
"src/core/lib/transport/transport.h",
"src/core/lib/transport/transport_impl.h",
"src/core/ext/census/context.c",
"src/core/ext/census/grpc_context.c",
"src/core/ext/census/grpc_filter.c",
"src/core/ext/census/grpc_plugin.c",
"src/core/ext/census/initialize.c",
"src/core/ext/census/mlog.c",
"src/core/ext/census/operation.c",
"src/core/ext/census/placeholders.c",
"src/core/ext/census/tracing.c",
"src/core/ext/lb_policy/grpclb/load_balancer_api.c",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c",
"src/core/ext/lb_policy/pick_first/pick_first.c",
"src/core/ext/lb_policy/round_robin/round_robin.c",
"src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create.c",
"src/core/ext/transport/chttp2/server/insecure/server_chttp2.c",
"src/core/ext/transport/chttp2/transport/alpn.c",
@ -675,15 +680,6 @@ cc_library(
"src/core/ext/transport/chttp2/transport/timeout_encoding.c",
"src/core/ext/transport/chttp2/transport/varint.c",
"src/core/ext/transport/chttp2/transport/writing.c",
"src/core/lib/census/context.c",
"src/core/lib/census/grpc_context.c",
"src/core/lib/census/grpc_filter.c",
"src/core/lib/census/grpc_plugin.c",
"src/core/lib/census/initialize.c",
"src/core/lib/census/mlog.c",
"src/core/lib/census/operation.c",
"src/core/lib/census/placeholders.c",
"src/core/lib/census/tracing.c",
"src/core/lib/channel/channel_args.c",
"src/core/lib/channel/channel_stack.c",
"src/core/lib/channel/channel_stack_builder.c",
@ -703,8 +699,6 @@ cc_library(
"src/core/lib/client_config/resolver.c",
"src/core/lib/client_config/resolver_factory.c",
"src/core/lib/client_config/resolver_registry.c",
"src/core/lib/client_config/resolvers/dns_resolver.c",
"src/core/lib/client_config/resolvers/sockaddr_resolver.c",
"src/core/lib/client_config/subchannel.c",
"src/core/lib/client_config/subchannel_factory.c",
"src/core/lib/client_config/subchannel_index.c",
@ -821,8 +815,7 @@ cc_library(
cc_library(
name = "grpc_zookeeper",
srcs = [
"src/core/lib/client_config/resolvers/zookeeper_resolver.h",
"src/core/lib/client_config/resolvers/zookeeper_resolver.c",
"src/core/ext/resolver/zookeeper/zookeeper_resolver.c",
],
hdrs = [
"include/grpc/grpc_zookeeper.h",
@ -1355,10 +1348,21 @@ objc_library(
objc_library(
name = "grpc_objc",
srcs = [
"src/core/ext/census/context.c",
"src/core/ext/census/grpc_context.c",
"src/core/ext/census/grpc_filter.c",
"src/core/ext/census/grpc_plugin.c",
"src/core/ext/census/initialize.c",
"src/core/ext/census/mlog.c",
"src/core/ext/census/operation.c",
"src/core/ext/census/placeholders.c",
"src/core/ext/census/tracing.c",
"src/core/ext/lb_policy/grpclb/load_balancer_api.c",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c",
"src/core/ext/lb_policy/pick_first/pick_first.c",
"src/core/ext/lb_policy/round_robin/round_robin.c",
"src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create.c",
"src/core/ext/transport/chttp2/client/secure/secure_channel_create.c",
"src/core/ext/transport/chttp2/server/insecure/server_chttp2.c",
@ -1384,15 +1388,6 @@ objc_library(
"src/core/ext/transport/chttp2/transport/timeout_encoding.c",
"src/core/ext/transport/chttp2/transport/varint.c",
"src/core/ext/transport/chttp2/transport/writing.c",
"src/core/lib/census/context.c",
"src/core/lib/census/grpc_context.c",
"src/core/lib/census/grpc_filter.c",
"src/core/lib/census/grpc_plugin.c",
"src/core/lib/census/initialize.c",
"src/core/lib/census/mlog.c",
"src/core/lib/census/operation.c",
"src/core/lib/census/placeholders.c",
"src/core/lib/census/tracing.c",
"src/core/lib/channel/channel_args.c",
"src/core/lib/channel/channel_stack.c",
"src/core/lib/channel/channel_stack_builder.c",
@ -1412,8 +1407,6 @@ objc_library(
"src/core/lib/client_config/resolver.c",
"src/core/lib/client_config/resolver_factory.c",
"src/core/lib/client_config/resolver_registry.c",
"src/core/lib/client_config/resolvers/dns_resolver.c",
"src/core/lib/client_config/resolvers/sockaddr_resolver.c",
"src/core/lib/client_config/subchannel.c",
"src/core/lib/client_config/subchannel_factory.c",
"src/core/lib/client_config/subchannel_index.c",
@ -1530,6 +1523,12 @@ objc_library(
"include/grpc/impl/codegen/propagation_bits.h",
"include/grpc/impl/codegen/status.h",
"include/grpc/status.h",
"src/core/ext/census/aggregation.h",
"src/core/ext/census/census_interface.h",
"src/core/ext/census/census_rpc_stats.h",
"src/core/ext/census/grpc_filter.h",
"src/core/ext/census/mlog.h",
"src/core/ext/census/rpc_metric_id.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h",
"src/core/ext/transport/chttp2/transport/alpn.h",
@ -1553,11 +1552,6 @@ objc_library(
"src/core/ext/transport/chttp2/transport/stream_map.h",
"src/core/ext/transport/chttp2/transport/timeout_encoding.h",
"src/core/ext/transport/chttp2/transport/varint.h",
"src/core/lib/census/aggregation.h",
"src/core/lib/census/grpc_filter.h",
"src/core/lib/census/grpc_plugin.h",
"src/core/lib/census/mlog.h",
"src/core/lib/census/rpc_metric_id.h",
"src/core/lib/channel/channel_args.h",
"src/core/lib/channel/channel_stack.h",
"src/core/lib/channel/channel_stack_builder.h",
@ -1577,8 +1571,6 @@ objc_library(
"src/core/lib/client_config/resolver.h",
"src/core/lib/client_config/resolver_factory.h",
"src/core/lib/client_config/resolver_registry.h",
"src/core/lib/client_config/resolvers/dns_resolver.h",
"src/core/lib/client_config/resolvers/sockaddr_resolver.h",
"src/core/lib/client_config/subchannel.h",
"src/core/lib/client_config/subchannel_factory.h",
"src/core/lib/client_config/subchannel_index.h",
@ -1639,8 +1631,6 @@ objc_library(
"src/core/lib/security/secure_endpoint.h",
"src/core/lib/security/security_connector.h",
"src/core/lib/security/security_context.h",
"src/core/lib/statistics/census_interface.h",
"src/core/lib/statistics/census_rpc_stats.h",
"src/core/lib/surface/api_trace.h",
"src/core/lib/surface/call.h",
"src/core/lib/surface/call_test_only.h",

@ -902,6 +902,7 @@ fling_stream_test: $(BINDIR)/$(CONFIG)/fling_stream_test
fling_test: $(BINDIR)/$(CONFIG)/fling_test
gen_hpack_tables: $(BINDIR)/$(CONFIG)/gen_hpack_tables
gen_legal_metadata_characters: $(BINDIR)/$(CONFIG)/gen_legal_metadata_characters
goaway_server_test: $(BINDIR)/$(CONFIG)/goaway_server_test
gpr_avl_test: $(BINDIR)/$(CONFIG)/gpr_avl_test
gpr_backoff_test: $(BINDIR)/$(CONFIG)/gpr_backoff_test
gpr_cmdline_test: $(BINDIR)/$(CONFIG)/gpr_cmdline_test
@ -1109,6 +1110,10 @@ h2_sockpair_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair_nosec_test
h2_sockpair+trace_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test
h2_sockpair_1byte_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair_1byte_nosec_test
h2_uds_nosec_test: $(BINDIR)/$(CONFIG)/h2_uds_nosec_test
hpack_parser_fuzzer_test_one_entry: $(BINDIR)/$(CONFIG)/hpack_parser_fuzzer_test_one_entry
http_fuzzer_test_one_entry: $(BINDIR)/$(CONFIG)/http_fuzzer_test_one_entry
json_fuzzer_test_one_entry: $(BINDIR)/$(CONFIG)/json_fuzzer_test_one_entry
uri_fuzzer_test_one_entry: $(BINDIR)/$(CONFIG)/uri_fuzzer_test_one_entry
run_dep_checks:
$(OPENSSL_ALPN_CHECK_CMD) || true
@ -1165,7 +1170,7 @@ plugins: $(PROTOC_PLUGINS)
privatelibs: privatelibs_c privatelibs_cxx
privatelibs_c: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a
privatelibs_c: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a
pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc
pc_c_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc
@ -1215,6 +1220,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/fling_server \
$(BINDIR)/$(CONFIG)/fling_stream_test \
$(BINDIR)/$(CONFIG)/fling_test \
$(BINDIR)/$(CONFIG)/goaway_server_test \
$(BINDIR)/$(CONFIG)/gpr_avl_test \
$(BINDIR)/$(CONFIG)/gpr_backoff_test \
$(BINDIR)/$(CONFIG)/gpr_cmdline_test \
@ -1326,6 +1332,10 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test \
$(BINDIR)/$(CONFIG)/h2_sockpair_1byte_nosec_test \
$(BINDIR)/$(CONFIG)/h2_uds_nosec_test \
$(BINDIR)/$(CONFIG)/hpack_parser_fuzzer_test_one_entry \
$(BINDIR)/$(CONFIG)/http_fuzzer_test_one_entry \
$(BINDIR)/$(CONFIG)/json_fuzzer_test_one_entry \
$(BINDIR)/$(CONFIG)/uri_fuzzer_test_one_entry \
buildtests_cxx: buildtests_zookeeper privatelibs_cxx \
@ -1466,6 +1476,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/fling_stream_test || ( echo test fling_stream_test failed ; exit 1 )
$(E) "[RUN] Testing fling_test"
$(Q) $(BINDIR)/$(CONFIG)/fling_test || ( echo test fling_test failed ; exit 1 )
$(E) "[RUN] Testing goaway_server_test"
$(Q) $(BINDIR)/$(CONFIG)/goaway_server_test || ( echo test goaway_server_test failed ; exit 1 )
$(E) "[RUN] Testing gpr_avl_test"
$(Q) $(BINDIR)/$(CONFIG)/gpr_avl_test || ( echo test gpr_avl_test failed ; exit 1 )
$(E) "[RUN] Testing gpr_backoff_test"
@ -2426,10 +2438,21 @@ endif
LIBGRPC_SRC = \
src/core/ext/census/context.c \
src/core/ext/census/grpc_context.c \
src/core/ext/census/grpc_filter.c \
src/core/ext/census/grpc_plugin.c \
src/core/ext/census/initialize.c \
src/core/ext/census/mlog.c \
src/core/ext/census/operation.c \
src/core/ext/census/placeholders.c \
src/core/ext/census/tracing.c \
src/core/ext/lb_policy/grpclb/load_balancer_api.c \
src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \
src/core/ext/lb_policy/pick_first/pick_first.c \
src/core/ext/lb_policy/round_robin/round_robin.c \
src/core/ext/resolver/dns/native/dns_resolver.c \
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \
src/core/ext/transport/chttp2/client/insecure/channel_create.c \
src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \
@ -2455,15 +2478,6 @@ LIBGRPC_SRC = \
src/core/ext/transport/chttp2/transport/timeout_encoding.c \
src/core/ext/transport/chttp2/transport/varint.c \
src/core/ext/transport/chttp2/transport/writing.c \
src/core/lib/census/context.c \
src/core/lib/census/grpc_context.c \
src/core/lib/census/grpc_filter.c \
src/core/lib/census/grpc_plugin.c \
src/core/lib/census/initialize.c \
src/core/lib/census/mlog.c \
src/core/lib/census/operation.c \
src/core/lib/census/placeholders.c \
src/core/lib/census/tracing.c \
src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_stack.c \
src/core/lib/channel/channel_stack_builder.c \
@ -2483,8 +2497,6 @@ LIBGRPC_SRC = \
src/core/lib/client_config/resolver.c \
src/core/lib/client_config/resolver_factory.c \
src/core/lib/client_config/resolver_registry.c \
src/core/lib/client_config/resolvers/dns_resolver.c \
src/core/lib/client_config/resolvers/sockaddr_resolver.c \
src/core/lib/client_config/subchannel.c \
src/core/lib/client_config/subchannel_factory.c \
src/core/lib/client_config/subchannel_index.c \
@ -2786,10 +2798,21 @@ endif
LIBGRPC_UNSECURE_SRC = \
src/core/ext/census/context.c \
src/core/ext/census/grpc_context.c \
src/core/ext/census/grpc_filter.c \
src/core/ext/census/grpc_plugin.c \
src/core/ext/census/initialize.c \
src/core/ext/census/mlog.c \
src/core/ext/census/operation.c \
src/core/ext/census/placeholders.c \
src/core/ext/census/tracing.c \
src/core/ext/lb_policy/grpclb/load_balancer_api.c \
src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \
src/core/ext/lb_policy/pick_first/pick_first.c \
src/core/ext/lb_policy/round_robin/round_robin.c \
src/core/ext/resolver/dns/native/dns_resolver.c \
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \
src/core/ext/transport/chttp2/client/insecure/channel_create.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \
src/core/ext/transport/chttp2/transport/alpn.c \
@ -2813,15 +2836,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/transport/chttp2/transport/timeout_encoding.c \
src/core/ext/transport/chttp2/transport/varint.c \
src/core/ext/transport/chttp2/transport/writing.c \
src/core/lib/census/context.c \
src/core/lib/census/grpc_context.c \
src/core/lib/census/grpc_filter.c \
src/core/lib/census/grpc_plugin.c \
src/core/lib/census/initialize.c \
src/core/lib/census/mlog.c \
src/core/lib/census/operation.c \
src/core/lib/census/placeholders.c \
src/core/lib/census/tracing.c \
src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_stack.c \
src/core/lib/channel/channel_stack_builder.c \
@ -2841,8 +2855,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/client_config/resolver.c \
src/core/lib/client_config/resolver_factory.c \
src/core/lib/client_config/resolver_registry.c \
src/core/lib/client_config/resolvers/dns_resolver.c \
src/core/lib/client_config/resolvers/sockaddr_resolver.c \
src/core/lib/client_config/subchannel.c \
src/core/lib/client_config/subchannel_factory.c \
src/core/lib/client_config/subchannel_index.c \
@ -2982,7 +2994,7 @@ endif
LIBGRPC_ZOOKEEPER_SRC = \
src/core/lib/client_config/resolvers/zookeeper_resolver.c \
src/core/ext/resolver/zookeeper/zookeeper_resolver.c \
PUBLIC_HEADERS_C += \
include/grpc/grpc_zookeeper.h \
@ -3024,6 +3036,31 @@ ifneq ($(NO_DEPS),true)
endif
LIBONE_INPUT_FUZZER_SRC = \
test/core/util/one_corpus_entry_fuzzer.c \
PUBLIC_HEADERS_C += \
LIBONE_INPUT_FUZZER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBONE_INPUT_FUZZER_SRC))))
$(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a: $(ZLIB_DEP) $(LIBONE_INPUT_FUZZER_OBJS)
$(E) "[AR] Creating $@"
$(Q) mkdir -p `dirname $@`
$(Q) rm -f $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a
$(Q) $(AR) $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBONE_INPUT_FUZZER_OBJS)
ifeq ($(SYSTEM),Darwin)
$(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a
endif
ifneq ($(NO_DEPS),true)
-include $(LIBONE_INPUT_FUZZER_OBJS:.o=.dep)
endif
LIBRECONNECT_SERVER_SRC = \
test/core/util/reconnect_server.c \
@ -6736,6 +6773,38 @@ endif
endif
GOAWAY_SERVER_TEST_SRC = \
test/core/end2end/goaway_server_test.c \
GOAWAY_SERVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GOAWAY_SERVER_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/goaway_server_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/goaway_server_test: $(GOAWAY_SERVER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(GOAWAY_SERVER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/goaway_server_test
endif
$(OBJDIR)/$(CONFIG)/test/core/end2end/goaway_server_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_goaway_server_test: $(GOAWAY_SERVER_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(GOAWAY_SERVER_TEST_OBJS:.o=.dep)
endif
endif
GPR_AVL_TEST_SRC = \
test/core/support/avl_test.c \
@ -13505,6 +13574,134 @@ ifneq ($(NO_DEPS),true)
endif
HPACK_PARSER_FUZZER_TEST_ONE_ENTRY_SRC = \
test/core/transport/chttp2/hpack_parser_fuzzer_test.c \
HPACK_PARSER_FUZZER_TEST_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HPACK_PARSER_FUZZER_TEST_ONE_ENTRY_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/hpack_parser_fuzzer_test_one_entry: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/hpack_parser_fuzzer_test_one_entry: $(HPACK_PARSER_FUZZER_TEST_ONE_ENTRY_OBJS) $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(HPACK_PARSER_FUZZER_TEST_ONE_ENTRY_OBJS) $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/hpack_parser_fuzzer_test_one_entry
endif
$(OBJDIR)/$(CONFIG)/test/core/transport/chttp2/hpack_parser_fuzzer_test.o: $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_hpack_parser_fuzzer_test_one_entry: $(HPACK_PARSER_FUZZER_TEST_ONE_ENTRY_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(HPACK_PARSER_FUZZER_TEST_ONE_ENTRY_OBJS:.o=.dep)
endif
endif
HTTP_FUZZER_TEST_ONE_ENTRY_SRC = \
test/core/http/fuzzer.c \
HTTP_FUZZER_TEST_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTP_FUZZER_TEST_ONE_ENTRY_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/http_fuzzer_test_one_entry: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/http_fuzzer_test_one_entry: $(HTTP_FUZZER_TEST_ONE_ENTRY_OBJS) $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(HTTP_FUZZER_TEST_ONE_ENTRY_OBJS) $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/http_fuzzer_test_one_entry
endif
$(OBJDIR)/$(CONFIG)/test/core/http/fuzzer.o: $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_http_fuzzer_test_one_entry: $(HTTP_FUZZER_TEST_ONE_ENTRY_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(HTTP_FUZZER_TEST_ONE_ENTRY_OBJS:.o=.dep)
endif
endif
JSON_FUZZER_TEST_ONE_ENTRY_SRC = \
test/core/json/fuzzer.c \
JSON_FUZZER_TEST_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(JSON_FUZZER_TEST_ONE_ENTRY_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/json_fuzzer_test_one_entry: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/json_fuzzer_test_one_entry: $(JSON_FUZZER_TEST_ONE_ENTRY_OBJS) $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(JSON_FUZZER_TEST_ONE_ENTRY_OBJS) $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/json_fuzzer_test_one_entry
endif
$(OBJDIR)/$(CONFIG)/test/core/json/fuzzer.o: $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_json_fuzzer_test_one_entry: $(JSON_FUZZER_TEST_ONE_ENTRY_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(JSON_FUZZER_TEST_ONE_ENTRY_OBJS:.o=.dep)
endif
endif
URI_FUZZER_TEST_ONE_ENTRY_SRC = \
test/core/client_config/uri_fuzzer_test.c \
URI_FUZZER_TEST_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(URI_FUZZER_TEST_ONE_ENTRY_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/uri_fuzzer_test_one_entry: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/uri_fuzzer_test_one_entry: $(URI_FUZZER_TEST_ONE_ENTRY_OBJS) $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(URI_FUZZER_TEST_ONE_ENTRY_OBJS) $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/uri_fuzzer_test_one_entry
endif
$(OBJDIR)/$(CONFIG)/test/core/client_config/uri_fuzzer_test.o: $(LIBDIR)/$(CONFIG)/libone_input_fuzzer.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_uri_fuzzer_test_one_entry: $(URI_FUZZER_TEST_ONE_ENTRY_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(URI_FUZZER_TEST_ONE_ENTRY_OBJS:.o=.dep)
endif
endif

@ -558,10 +558,21 @@
'gpr',
],
'sources': [
'src/core/ext/census/context.c',
'src/core/ext/census/grpc_context.c',
'src/core/ext/census/grpc_filter.c',
'src/core/ext/census/grpc_plugin.c',
'src/core/ext/census/initialize.c',
'src/core/ext/census/mlog.c',
'src/core/ext/census/operation.c',
'src/core/ext/census/placeholders.c',
'src/core/ext/census/tracing.c',
'src/core/ext/lb_policy/grpclb/load_balancer_api.c',
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c',
'src/core/ext/lb_policy/pick_first/pick_first.c',
'src/core/ext/lb_policy/round_robin/round_robin.c',
'src/core/ext/resolver/dns/native/dns_resolver.c',
'src/core/ext/resolver/sockaddr/sockaddr_resolver.c',
'src/core/ext/transport/chttp2/client/insecure/channel_create.c',
'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',
@ -587,15 +598,6 @@
'src/core/ext/transport/chttp2/transport/timeout_encoding.c',
'src/core/ext/transport/chttp2/transport/varint.c',
'src/core/ext/transport/chttp2/transport/writing.c',
'src/core/lib/census/context.c',
'src/core/lib/census/grpc_context.c',
'src/core/lib/census/grpc_filter.c',
'src/core/lib/census/grpc_plugin.c',
'src/core/lib/census/initialize.c',
'src/core/lib/census/mlog.c',
'src/core/lib/census/operation.c',
'src/core/lib/census/placeholders.c',
'src/core/lib/census/tracing.c',
'src/core/lib/channel/channel_args.c',
'src/core/lib/channel/channel_stack.c',
'src/core/lib/channel/channel_stack_builder.c',
@ -615,8 +617,6 @@
'src/core/lib/client_config/resolver.c',
'src/core/lib/client_config/resolver_factory.c',
'src/core/lib/client_config/resolver_registry.c',
'src/core/lib/client_config/resolvers/dns_resolver.c',
'src/core/lib/client_config/resolvers/sockaddr_resolver.c',
'src/core/lib/client_config/subchannel.c',
'src/core/lib/client_config/subchannel_factory.c',
'src/core/lib/client_config/subchannel_index.c',

@ -13,16 +13,23 @@ filegroups:
public_headers:
- include/grpc/census.h
headers:
- src/core/lib/census/aggregation.h
- src/core/lib/census/mlog.h
- src/core/lib/census/rpc_metric_id.h
src:
- src/core/lib/census/context.c
- src/core/lib/census/initialize.c
- src/core/lib/census/mlog.c
- src/core/lib/census/operation.c
- src/core/lib/census/placeholders.c
- src/core/lib/census/tracing.c
- src/core/ext/census/aggregation.h
- src/core/ext/census/census_interface.h
- src/core/ext/census/census_rpc_stats.h
- src/core/ext/census/grpc_filter.h
- src/core/ext/census/mlog.h
- src/core/ext/census/rpc_metric_id.h
src:
- src/core/ext/census/context.c
- src/core/ext/census/grpc_context.c
- src/core/ext/census/grpc_filter.c
- src/core/ext/census/grpc_plugin.c
- src/core/ext/census/initialize.c
- src/core/ext/census/mlog.c
- src/core/ext/census/operation.c
- src/core/ext/census/placeholders.c
- src/core/ext/census/tracing.c
plugin: census_grpc_plugin
- name: gpr
public_headers:
- include/grpc/support/alloc.h
@ -247,8 +254,6 @@ filegroups:
- include/grpc/grpc.h
- include/grpc/status.h
headers:
- src/core/lib/census/grpc_filter.h
- src/core/lib/census/grpc_plugin.h
- src/core/lib/channel/channel_args.h
- src/core/lib/channel/channel_stack.h
- src/core/lib/channel/channel_stack_builder.h
@ -268,8 +273,6 @@ filegroups:
- src/core/lib/client_config/resolver.h
- src/core/lib/client_config/resolver_factory.h
- src/core/lib/client_config/resolver_registry.h
- src/core/lib/client_config/resolvers/dns_resolver.h
- src/core/lib/client_config/resolvers/sockaddr_resolver.h
- src/core/lib/client_config/subchannel.h
- src/core/lib/client_config/subchannel_factory.h
- src/core/lib/client_config/subchannel_index.h
@ -321,8 +324,6 @@ filegroups:
- src/core/lib/json/json_common.h
- src/core/lib/json/json_reader.h
- src/core/lib/json/json_writer.h
- src/core/lib/statistics/census_interface.h
- src/core/lib/statistics/census_rpc_stats.h
- src/core/lib/surface/api_trace.h
- src/core/lib/surface/call.h
- src/core/lib/surface/call_test_only.h
@ -343,9 +344,6 @@ filegroups:
- src/core/lib/transport/transport.h
- src/core/lib/transport/transport_impl.h
src:
- src/core/lib/census/grpc_context.c
- src/core/lib/census/grpc_filter.c
- src/core/lib/census/grpc_plugin.c
- src/core/lib/channel/channel_args.c
- src/core/lib/channel/channel_stack.c
- src/core/lib/channel/channel_stack_builder.c
@ -365,8 +363,6 @@ filegroups:
- src/core/lib/client_config/resolver.c
- src/core/lib/client_config/resolver_factory.c
- src/core/lib/client_config/resolver_registry.c
- src/core/lib/client_config/resolvers/dns_resolver.c
- src/core/lib/client_config/resolvers/sockaddr_resolver.c
- src/core/lib/client_config/subchannel.c
- src/core/lib/client_config/subchannel_factory.c
- src/core/lib/client_config/subchannel_index.c
@ -477,6 +473,18 @@ filegroups:
plugin: grpc_lb_policy_round_robin
uses:
- grpc_base
- name: grpc_resolver_dns_native
src:
- src/core/ext/resolver/dns/native/dns_resolver.c
plugin: grpc_resolver_dns_native
uses:
- grpc_base
- name: grpc_resolver_sockaddr
src:
- src/core/ext/resolver/sockaddr/sockaddr_resolver.c
plugin: grpc_resolver_sockaddr
uses:
- grpc_base
- name: grpc_secure
headers:
- src/core/lib/security/auth_filters.h
@ -653,6 +661,8 @@ libs:
- grpc_lb_policy_grpclb
- grpc_lb_policy_pick_first
- grpc_lb_policy_round_robin
- grpc_resolver_dns_native
- grpc_resolver_sockaddr
- grpc_secure
- grpc_codegen
- census
@ -737,6 +747,8 @@ libs:
- grpc_base
- grpc_transport_chttp2_server_insecure
- grpc_transport_chttp2_client_insecure
- grpc_resolver_dns_native
- grpc_resolver_sockaddr
- grpc_lb_policy_grpclb
- grpc_lb_policy_pick_first
- grpc_lb_policy_round_robin
@ -751,10 +763,8 @@ libs:
language: c
public_headers:
- include/grpc/grpc_zookeeper.h
headers:
- src/core/lib/client_config/resolvers/zookeeper_resolver.h
src:
- src/core/lib/client_config/resolvers/zookeeper_resolver.c
- src/core/ext/resolver/zookeeper/zookeeper_resolver.c
deps:
- gpr
- grpc
@ -763,6 +773,14 @@ libs:
platforms:
- linux
secure: false
- name: one_input_fuzzer
build: private
language: c
src:
- test/core/util/one_corpus_entry_fuzzer.c
deps:
- gpr
secure: false
- name: reconnect_server
build: private
language: c
@ -1292,6 +1310,21 @@ targets:
src:
- tools/codegen/core/gen_legal_metadata_characters.c
deps: []
- name: goaway_server_test
cpu_cost: 0.1
build: test
language: c
src:
- test/core/end2end/goaway_server_test.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
platforms:
- mac
- linux
- posix
- name: gpr_avl_test
build: test
language: c

@ -80,10 +80,21 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/support/tmpfile_posix.c \
src/core/lib/support/tmpfile_win32.c \
src/core/lib/support/wrap_memcpy.c \
src/core/ext/census/context.c \
src/core/ext/census/grpc_context.c \
src/core/ext/census/grpc_filter.c \
src/core/ext/census/grpc_plugin.c \
src/core/ext/census/initialize.c \
src/core/ext/census/mlog.c \
src/core/ext/census/operation.c \
src/core/ext/census/placeholders.c \
src/core/ext/census/tracing.c \
src/core/ext/lb_policy/grpclb/load_balancer_api.c \
src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \
src/core/ext/lb_policy/pick_first/pick_first.c \
src/core/ext/lb_policy/round_robin/round_robin.c \
src/core/ext/resolver/dns/native/dns_resolver.c \
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \
src/core/ext/transport/chttp2/client/insecure/channel_create.c \
src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \
@ -109,15 +120,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/transport/chttp2/transport/timeout_encoding.c \
src/core/ext/transport/chttp2/transport/varint.c \
src/core/ext/transport/chttp2/transport/writing.c \
src/core/lib/census/context.c \
src/core/lib/census/grpc_context.c \
src/core/lib/census/grpc_filter.c \
src/core/lib/census/grpc_plugin.c \
src/core/lib/census/initialize.c \
src/core/lib/census/mlog.c \
src/core/lib/census/operation.c \
src/core/lib/census/placeholders.c \
src/core/lib/census/tracing.c \
src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_stack.c \
src/core/lib/channel/channel_stack_builder.c \
@ -137,8 +139,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/client_config/resolver.c \
src/core/lib/client_config/resolver_factory.c \
src/core/lib/client_config/resolver_registry.c \
src/core/lib/client_config/resolvers/dns_resolver.c \
src/core/lib/client_config/resolvers/sockaddr_resolver.c \
src/core/lib/client_config/subchannel.c \
src/core/lib/client_config/subchannel_factory.c \
src/core/lib/client_config/subchannel_index.c \
@ -545,19 +545,20 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/php/ext/grpc)
PHP_ADD_BUILD_DIR($ext_builddir/src/boringssl)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/pick_first)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/round_robin)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/resolver/dns/native)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/resolver/sockaddr)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/insecure)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/secure)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/server/insecure)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/server/secure)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/transport)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/census)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/channel)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/client_config)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/client_config/resolvers)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/compression)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/debug)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/http)

@ -161,6 +161,12 @@ Pod::Spec.new do |s|
'src/core/lib/support/tmpfile_posix.c',
'src/core/lib/support/tmpfile_win32.c',
'src/core/lib/support/wrap_memcpy.c',
'src/core/ext/census/aggregation.h',
'src/core/ext/census/census_interface.h',
'src/core/ext/census/census_rpc_stats.h',
'src/core/ext/census/grpc_filter.h',
'src/core/ext/census/mlog.h',
'src/core/ext/census/rpc_metric_id.h',
'src/core/ext/lb_policy/grpclb/load_balancer_api.h',
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h',
'src/core/ext/transport/chttp2/transport/alpn.h',
@ -184,11 +190,6 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/stream_map.h',
'src/core/ext/transport/chttp2/transport/timeout_encoding.h',
'src/core/ext/transport/chttp2/transport/varint.h',
'src/core/lib/census/aggregation.h',
'src/core/lib/census/grpc_filter.h',
'src/core/lib/census/grpc_plugin.h',
'src/core/lib/census/mlog.h',
'src/core/lib/census/rpc_metric_id.h',
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
@ -208,8 +209,6 @@ Pod::Spec.new do |s|
'src/core/lib/client_config/resolver.h',
'src/core/lib/client_config/resolver_factory.h',
'src/core/lib/client_config/resolver_registry.h',
'src/core/lib/client_config/resolvers/dns_resolver.h',
'src/core/lib/client_config/resolvers/sockaddr_resolver.h',
'src/core/lib/client_config/subchannel.h',
'src/core/lib/client_config/subchannel_factory.h',
'src/core/lib/client_config/subchannel_index.h',
@ -270,8 +269,6 @@ Pod::Spec.new do |s|
'src/core/lib/security/secure_endpoint.h',
'src/core/lib/security/security_connector.h',
'src/core/lib/security/security_context.h',
'src/core/lib/statistics/census_interface.h',
'src/core/lib/statistics/census_rpc_stats.h',
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',
@ -313,10 +310,21 @@ Pod::Spec.new do |s|
'include/grpc/impl/codegen/propagation_bits.h',
'include/grpc/impl/codegen/status.h',
'include/grpc/status.h',
'src/core/ext/census/context.c',
'src/core/ext/census/grpc_context.c',
'src/core/ext/census/grpc_filter.c',
'src/core/ext/census/grpc_plugin.c',
'src/core/ext/census/initialize.c',
'src/core/ext/census/mlog.c',
'src/core/ext/census/operation.c',
'src/core/ext/census/placeholders.c',
'src/core/ext/census/tracing.c',
'src/core/ext/lb_policy/grpclb/load_balancer_api.c',
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c',
'src/core/ext/lb_policy/pick_first/pick_first.c',
'src/core/ext/lb_policy/round_robin/round_robin.c',
'src/core/ext/resolver/dns/native/dns_resolver.c',
'src/core/ext/resolver/sockaddr/sockaddr_resolver.c',
'src/core/ext/transport/chttp2/client/insecure/channel_create.c',
'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',
@ -342,15 +350,6 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/timeout_encoding.c',
'src/core/ext/transport/chttp2/transport/varint.c',
'src/core/ext/transport/chttp2/transport/writing.c',
'src/core/lib/census/context.c',
'src/core/lib/census/grpc_context.c',
'src/core/lib/census/grpc_filter.c',
'src/core/lib/census/grpc_plugin.c',
'src/core/lib/census/initialize.c',
'src/core/lib/census/mlog.c',
'src/core/lib/census/operation.c',
'src/core/lib/census/placeholders.c',
'src/core/lib/census/tracing.c',
'src/core/lib/channel/channel_args.c',
'src/core/lib/channel/channel_stack.c',
'src/core/lib/channel/channel_stack_builder.c',
@ -370,8 +369,6 @@ Pod::Spec.new do |s|
'src/core/lib/client_config/resolver.c',
'src/core/lib/client_config/resolver_factory.c',
'src/core/lib/client_config/resolver_registry.c',
'src/core/lib/client_config/resolvers/dns_resolver.c',
'src/core/lib/client_config/resolvers/sockaddr_resolver.c',
'src/core/lib/client_config/subchannel.c',
'src/core/lib/client_config/subchannel_factory.c',
'src/core/lib/client_config/subchannel_index.c',
@ -489,6 +486,12 @@ Pod::Spec.new do |s|
'src/core/lib/support/thd_internal.h',
'src/core/lib/support/time_precise.h',
'src/core/lib/support/tmpfile.h',
'src/core/ext/census/aggregation.h',
'src/core/ext/census/census_interface.h',
'src/core/ext/census/census_rpc_stats.h',
'src/core/ext/census/grpc_filter.h',
'src/core/ext/census/mlog.h',
'src/core/ext/census/rpc_metric_id.h',
'src/core/ext/lb_policy/grpclb/load_balancer_api.h',
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h',
'src/core/ext/transport/chttp2/transport/alpn.h',
@ -512,11 +515,6 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/stream_map.h',
'src/core/ext/transport/chttp2/transport/timeout_encoding.h',
'src/core/ext/transport/chttp2/transport/varint.h',
'src/core/lib/census/aggregation.h',
'src/core/lib/census/grpc_filter.h',
'src/core/lib/census/grpc_plugin.h',
'src/core/lib/census/mlog.h',
'src/core/lib/census/rpc_metric_id.h',
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h',
@ -536,8 +534,6 @@ Pod::Spec.new do |s|
'src/core/lib/client_config/resolver.h',
'src/core/lib/client_config/resolver_factory.h',
'src/core/lib/client_config/resolver_registry.h',
'src/core/lib/client_config/resolvers/dns_resolver.h',
'src/core/lib/client_config/resolvers/sockaddr_resolver.h',
'src/core/lib/client_config/subchannel.h',
'src/core/lib/client_config/subchannel_factory.h',
'src/core/lib/client_config/subchannel_index.h',
@ -598,8 +594,6 @@ Pod::Spec.new do |s|
'src/core/lib/security/secure_endpoint.h',
'src/core/lib/security/security_connector.h',
'src/core/lib/security/security_context.h',
'src/core/lib/statistics/census_interface.h',
'src/core/lib/statistics/census_rpc_stats.h',
'src/core/lib/surface/api_trace.h',
'src/core/lib/surface/call.h',
'src/core/lib/surface/call_test_only.h',

@ -157,6 +157,12 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/impl/codegen/propagation_bits.h )
s.files += %w( include/grpc/impl/codegen/status.h )
s.files += %w( include/grpc/status.h )
s.files += %w( src/core/ext/census/aggregation.h )
s.files += %w( src/core/ext/census/census_interface.h )
s.files += %w( src/core/ext/census/census_rpc_stats.h )
s.files += %w( src/core/ext/census/grpc_filter.h )
s.files += %w( src/core/ext/census/mlog.h )
s.files += %w( src/core/ext/census/rpc_metric_id.h )
s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.h )
s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h )
s.files += %w( src/core/ext/transport/chttp2/transport/alpn.h )
@ -180,11 +186,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/chttp2/transport/stream_map.h )
s.files += %w( src/core/ext/transport/chttp2/transport/timeout_encoding.h )
s.files += %w( src/core/ext/transport/chttp2/transport/varint.h )
s.files += %w( src/core/lib/census/aggregation.h )
s.files += %w( src/core/lib/census/grpc_filter.h )
s.files += %w( src/core/lib/census/grpc_plugin.h )
s.files += %w( src/core/lib/census/mlog.h )
s.files += %w( src/core/lib/census/rpc_metric_id.h )
s.files += %w( src/core/lib/channel/channel_args.h )
s.files += %w( src/core/lib/channel/channel_stack.h )
s.files += %w( src/core/lib/channel/channel_stack_builder.h )
@ -204,8 +205,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/client_config/resolver.h )
s.files += %w( src/core/lib/client_config/resolver_factory.h )
s.files += %w( src/core/lib/client_config/resolver_registry.h )
s.files += %w( src/core/lib/client_config/resolvers/dns_resolver.h )
s.files += %w( src/core/lib/client_config/resolvers/sockaddr_resolver.h )
s.files += %w( src/core/lib/client_config/subchannel.h )
s.files += %w( src/core/lib/client_config/subchannel_factory.h )
s.files += %w( src/core/lib/client_config/subchannel_index.h )
@ -266,8 +265,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/secure_endpoint.h )
s.files += %w( src/core/lib/security/security_connector.h )
s.files += %w( src/core/lib/security/security_context.h )
s.files += %w( src/core/lib/statistics/census_interface.h )
s.files += %w( src/core/lib/statistics/census_rpc_stats.h )
s.files += %w( src/core/lib/surface/api_trace.h )
s.files += %w( src/core/lib/surface/call.h )
s.files += %w( src/core/lib/surface/call_test_only.h )
@ -296,10 +293,21 @@ Gem::Specification.new do |s|
s.files += %w( third_party/nanopb/pb_common.h )
s.files += %w( third_party/nanopb/pb_decode.h )
s.files += %w( third_party/nanopb/pb_encode.h )
s.files += %w( src/core/ext/census/context.c )
s.files += %w( src/core/ext/census/grpc_context.c )
s.files += %w( src/core/ext/census/grpc_filter.c )
s.files += %w( src/core/ext/census/grpc_plugin.c )
s.files += %w( src/core/ext/census/initialize.c )
s.files += %w( src/core/ext/census/mlog.c )
s.files += %w( src/core/ext/census/operation.c )
s.files += %w( src/core/ext/census/placeholders.c )
s.files += %w( src/core/ext/census/tracing.c )
s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.c )
s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c )
s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.c )
s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.c )
s.files += %w( src/core/ext/resolver/dns/native/dns_resolver.c )
s.files += %w( src/core/ext/resolver/sockaddr/sockaddr_resolver.c )
s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.c )
s.files += %w( src/core/ext/transport/chttp2/client/secure/secure_channel_create.c )
s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2.c )
@ -325,15 +333,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/chttp2/transport/timeout_encoding.c )
s.files += %w( src/core/ext/transport/chttp2/transport/varint.c )
s.files += %w( src/core/ext/transport/chttp2/transport/writing.c )
s.files += %w( src/core/lib/census/context.c )
s.files += %w( src/core/lib/census/grpc_context.c )
s.files += %w( src/core/lib/census/grpc_filter.c )
s.files += %w( src/core/lib/census/grpc_plugin.c )
s.files += %w( src/core/lib/census/initialize.c )
s.files += %w( src/core/lib/census/mlog.c )
s.files += %w( src/core/lib/census/operation.c )
s.files += %w( src/core/lib/census/placeholders.c )
s.files += %w( src/core/lib/census/tracing.c )
s.files += %w( src/core/lib/channel/channel_args.c )
s.files += %w( src/core/lib/channel/channel_stack.c )
s.files += %w( src/core/lib/channel/channel_stack_builder.c )
@ -353,8 +352,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/client_config/resolver.c )
s.files += %w( src/core/lib/client_config/resolver_factory.c )
s.files += %w( src/core/lib/client_config/resolver_registry.c )
s.files += %w( src/core/lib/client_config/resolvers/dns_resolver.c )
s.files += %w( src/core/lib/client_config/resolvers/sockaddr_resolver.c )
s.files += %w( src/core/lib/client_config/subchannel.c )
s.files += %w( src/core/lib/client_config/subchannel_factory.c )
s.files += %w( src/core/lib/client_config/subchannel_index.c )

@ -100,6 +100,12 @@
"include/grpc/impl/codegen/propagation_bits.h",
"include/grpc/impl/codegen/status.h",
"include/grpc/status.h",
"src/core/ext/census/aggregation.h",
"src/core/ext/census/census_interface.h",
"src/core/ext/census/census_rpc_stats.h",
"src/core/ext/census/grpc_filter.h",
"src/core/ext/census/mlog.h",
"src/core/ext/census/rpc_metric_id.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h",
"src/core/ext/transport/chttp2/transport/alpn.h",
@ -123,11 +129,6 @@
"src/core/ext/transport/chttp2/transport/stream_map.h",
"src/core/ext/transport/chttp2/transport/timeout_encoding.h",
"src/core/ext/transport/chttp2/transport/varint.h",
"src/core/lib/census/aggregation.h",
"src/core/lib/census/grpc_filter.h",
"src/core/lib/census/grpc_plugin.h",
"src/core/lib/census/mlog.h",
"src/core/lib/census/rpc_metric_id.h",
"src/core/lib/channel/channel_args.h",
"src/core/lib/channel/channel_stack.h",
"src/core/lib/channel/channel_stack_builder.h",
@ -147,8 +148,6 @@
"src/core/lib/client_config/resolver.h",
"src/core/lib/client_config/resolver_factory.h",
"src/core/lib/client_config/resolver_registry.h",
"src/core/lib/client_config/resolvers/dns_resolver.h",
"src/core/lib/client_config/resolvers/sockaddr_resolver.h",
"src/core/lib/client_config/subchannel.h",
"src/core/lib/client_config/subchannel_factory.h",
"src/core/lib/client_config/subchannel_index.h",
@ -209,8 +208,6 @@
"src/core/lib/security/secure_endpoint.h",
"src/core/lib/security/security_connector.h",
"src/core/lib/security/security_context.h",
"src/core/lib/statistics/census_interface.h",
"src/core/lib/statistics/census_rpc_stats.h",
"src/core/lib/surface/api_trace.h",
"src/core/lib/surface/call.h",
"src/core/lib/surface/call_test_only.h",
@ -239,10 +236,21 @@
"third_party/nanopb/pb_common.h",
"third_party/nanopb/pb_decode.h",
"third_party/nanopb/pb_encode.h",
"src/core/ext/census/context.c",
"src/core/ext/census/grpc_context.c",
"src/core/ext/census/grpc_filter.c",
"src/core/ext/census/grpc_plugin.c",
"src/core/ext/census/initialize.c",
"src/core/ext/census/mlog.c",
"src/core/ext/census/operation.c",
"src/core/ext/census/placeholders.c",
"src/core/ext/census/tracing.c",
"src/core/ext/lb_policy/grpclb/load_balancer_api.c",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c",
"src/core/ext/lb_policy/pick_first/pick_first.c",
"src/core/ext/lb_policy/round_robin/round_robin.c",
"src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create.c",
"src/core/ext/transport/chttp2/client/secure/secure_channel_create.c",
"src/core/ext/transport/chttp2/server/insecure/server_chttp2.c",
@ -268,15 +276,6 @@
"src/core/ext/transport/chttp2/transport/timeout_encoding.c",
"src/core/ext/transport/chttp2/transport/varint.c",
"src/core/ext/transport/chttp2/transport/writing.c",
"src/core/lib/census/context.c",
"src/core/lib/census/grpc_context.c",
"src/core/lib/census/grpc_filter.c",
"src/core/lib/census/grpc_plugin.c",
"src/core/lib/census/initialize.c",
"src/core/lib/census/mlog.c",
"src/core/lib/census/operation.c",
"src/core/lib/census/placeholders.c",
"src/core/lib/census/tracing.c",
"src/core/lib/channel/channel_args.c",
"src/core/lib/channel/channel_stack.c",
"src/core/lib/channel/channel_stack_builder.c",
@ -296,8 +295,6 @@
"src/core/lib/client_config/resolver.c",
"src/core/lib/client_config/resolver_factory.c",
"src/core/lib/client_config/resolver_registry.c",
"src/core/lib/client_config/resolvers/dns_resolver.c",
"src/core/lib/client_config/resolvers/sockaddr_resolver.c",
"src/core/lib/client_config/subchannel.c",
"src/core/lib/client_config/subchannel_factory.c",
"src/core/lib/client_config/subchannel_index.c",

@ -161,6 +161,12 @@
<file baseinstalldir="/" name="include/grpc/impl/codegen/propagation_bits.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/status.h" role="src" />
<file baseinstalldir="/" name="include/grpc/status.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/aggregation.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/census_interface.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/census_rpc_stats.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/grpc_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/mlog.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/rpc_metric_id.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/lb_policy/grpclb/load_balancer_api.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/alpn.h" role="src" />
@ -184,11 +190,6 @@
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/stream_map.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/timeout_encoding.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/varint.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/aggregation.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/grpc_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/grpc_plugin.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/mlog.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/rpc_metric_id.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_args.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.h" role="src" />
@ -208,8 +209,6 @@
<file baseinstalldir="/" name="src/core/lib/client_config/resolver.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/resolver_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/resolver_registry.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/resolvers/dns_resolver.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/resolvers/sockaddr_resolver.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/subchannel.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/subchannel_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/subchannel_index.h" role="src" />
@ -270,8 +269,6 @@
<file baseinstalldir="/" name="src/core/lib/security/secure_endpoint.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_context.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/statistics/census_interface.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/statistics/census_rpc_stats.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/api_trace.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/call.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/call_test_only.h" role="src" />
@ -300,10 +297,21 @@
<file baseinstalldir="/" name="third_party/nanopb/pb_common.h" role="src" />
<file baseinstalldir="/" name="third_party/nanopb/pb_decode.h" role="src" />
<file baseinstalldir="/" name="third_party/nanopb/pb_encode.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/context.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/grpc_context.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/grpc_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/grpc_plugin.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/initialize.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/mlog.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/operation.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/placeholders.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/tracing.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/lb_policy/grpclb/load_balancer_api.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/lb_policy/pick_first/pick_first.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/lb_policy/round_robin/round_robin.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/resolver/dns/native/dns_resolver.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/resolver/sockaddr/sockaddr_resolver.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/insecure/channel_create.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/secure/secure_channel_create.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2.c" role="src" />
@ -329,15 +337,6 @@
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/timeout_encoding.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/varint.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/writing.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/context.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/grpc_context.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/grpc_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/grpc_plugin.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/initialize.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/mlog.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/operation.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/placeholders.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/census/tracing.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_args.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.c" role="src" />
@ -357,8 +356,6 @@
<file baseinstalldir="/" name="src/core/lib/client_config/resolver.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/resolver_factory.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/resolver_registry.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/resolvers/dns_resolver.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/resolvers/sockaddr_resolver.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/subchannel.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/subchannel_factory.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/client_config/subchannel_index.c" role="src" />

@ -33,8 +33,8 @@
#include <stddef.h>
#ifndef GRPC_CORE_LIB_CENSUS_AGGREGATION_H
#define GRPC_CORE_LIB_CENSUS_AGGREGATION_H
#ifndef GRPC_CORE_EXT_CENSUS_AGGREGATION_H
#define GRPC_CORE_EXT_CENSUS_AGGREGATION_H
/** Structure used to describe an aggregation type. */
struct census_aggregation_ops {
@ -63,4 +63,4 @@ struct census_aggregation_ops {
size_t (*print)(const void *aggregation, char *buffer, size_t n);
};
#endif /* GRPC_CORE_LIB_CENSUS_AGGREGATION_H */
#endif /* GRPC_CORE_EXT_CENSUS_AGGREGATION_H */

@ -31,11 +31,11 @@
*
*/
#include "src/core/lib/statistics/census_interface.h"
#include "src/core/ext/census/census_interface.h"
#include <grpc/support/log.h>
#include "src/core/lib/statistics/census_rpc_stats.h"
#include "src/core/lib/statistics/census_tracing.h"
#include "src/core/ext/census/census_rpc_stats.h"
#include "src/core/ext/census/census_tracing.h"
void census_init(void) {
census_tracing_init();

@ -31,8 +31,8 @@
*
*/
#ifndef GRPC_CORE_LIB_STATISTICS_CENSUS_INTERFACE_H
#define GRPC_CORE_LIB_STATISTICS_CENSUS_INTERFACE_H
#ifndef GRPC_CORE_EXT_CENSUS_CENSUS_INTERFACE_H
#define GRPC_CORE_EXT_CENSUS_CENSUS_INTERFACE_H
#include <grpc/support/port_platform.h>
@ -73,4 +73,4 @@ census_op_id census_tracing_start_op(void);
/* Ends tracing. Calling this function will invalidate the input op_id. */
void census_tracing_end_op(census_op_id op_id);
#endif /* GRPC_CORE_LIB_STATISTICS_CENSUS_INTERFACE_H */
#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_INTERFACE_H */

@ -89,7 +89,7 @@
include the name of the structure, which will be passed as the first
argument. E.g. cl_block_initialize() will initialize a cl_block.
*/
#include "src/core/lib/statistics/census_log.h"
#include "src/core/ext/census/census_log.h"
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/cpu.h>

@ -31,8 +31,8 @@
*
*/
#ifndef GRPC_CORE_LIB_STATISTICS_CENSUS_LOG_H
#define GRPC_CORE_LIB_STATISTICS_CENSUS_LOG_H
#ifndef GRPC_CORE_EXT_CENSUS_CENSUS_LOG_H
#define GRPC_CORE_EXT_CENSUS_CENSUS_LOG_H
#include <stddef.h>
@ -88,4 +88,4 @@ size_t census_log_remaining_space(void);
out-of-space. */
int census_log_out_of_space_count(void);
#endif /* GRPC_CORE_LIB_STATISTICS_CENSUS_LOG_H */
#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_LOG_H */

@ -36,11 +36,11 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include "src/core/lib/statistics/census_interface.h"
#include "src/core/lib/statistics/census_rpc_stats.h"
#include "src/core/lib/statistics/census_tracing.h"
#include "src/core/lib/statistics/hash_table.h"
#include "src/core/lib/statistics/window_stats.h"
#include "src/core/ext/census/census_interface.h"
#include "src/core/ext/census/census_rpc_stats.h"
#include "src/core/ext/census/census_tracing.h"
#include "src/core/ext/census/hash_table.h"
#include "src/core/ext/census/window_stats.h"
#include "src/core/lib/support/murmur_hash.h"
#include "src/core/lib/support/string.h"

@ -31,11 +31,11 @@
*
*/
#ifndef GRPC_CORE_LIB_STATISTICS_CENSUS_RPC_STATS_H
#define GRPC_CORE_LIB_STATISTICS_CENSUS_RPC_STATS_H
#ifndef GRPC_CORE_EXT_CENSUS_CENSUS_RPC_STATS_H
#define GRPC_CORE_EXT_CENSUS_CENSUS_RPC_STATS_H
#include <grpc/support/port_platform.h>
#include "src/core/lib/statistics/census_interface.h"
#include "src/core/ext/census/census_interface.h"
#ifdef __cplusplus
extern "C" {
@ -98,4 +98,4 @@ void census_stats_store_shutdown(void);
}
#endif
#endif /* GRPC_CORE_LIB_STATISTICS_CENSUS_RPC_STATS_H */
#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_RPC_STATS_H */

@ -31,8 +31,8 @@
*
*/
#include "src/core/lib/statistics/census_tracing.h"
#include "src/core/lib/statistics/census_interface.h"
#include "src/core/ext/census/census_tracing.h"
#include "src/core/ext/census/census_interface.h"
#include <stdio.h>
#include <string.h>
@ -41,7 +41,7 @@
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/sync.h>
#include "src/core/lib/statistics/hash_table.h"
#include "src/core/ext/census/hash_table.h"
#include "src/core/lib/support/string.h"
void census_trace_obj_destroy(census_trace_obj *obj) {

@ -31,11 +31,11 @@
*
*/
#ifndef GRPC_CORE_LIB_STATISTICS_CENSUS_TRACING_H
#define GRPC_CORE_LIB_STATISTICS_CENSUS_TRACING_H
#ifndef GRPC_CORE_EXT_CENSUS_CENSUS_TRACING_H
#define GRPC_CORE_EXT_CENSUS_CENSUS_TRACING_H
#include <grpc/support/time.h>
#include "src/core/lib/statistics/census_rpc_stats.h"
#include "src/core/ext/census/census_rpc_stats.h"
/* WARNING: The data structures and APIs provided by this file are for GRPC
library's internal use ONLY. They might be changed in backward-incompatible
@ -93,4 +93,4 @@ census_trace_obj **census_get_active_ops(int *num_active_ops);
}
#endif
#endif /* GRPC_CORE_LIB_STATISTICS_CENSUS_TRACING_H */
#endif /* GRPC_CORE_EXT_CENSUS_CENSUS_TRACING_H */

@ -31,7 +31,7 @@
*
*/
#include "src/core/lib/census/grpc_filter.h"
#include "src/core/ext/census/grpc_filter.h"
#include <stdio.h>
#include <string.h>
@ -42,9 +42,9 @@
#include <grpc/support/slice.h>
#include <grpc/support/time.h>
#include "src/core/ext/census/census_interface.h"
#include "src/core/ext/census/census_rpc_stats.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/statistics/census_interface.h"
#include "src/core/lib/statistics/census_rpc_stats.h"
#include "src/core/lib/transport/static_metadata.h"
typedef struct call_data {

@ -31,8 +31,8 @@
*
*/
#ifndef GRPC_CORE_LIB_CENSUS_GRPC_FILTER_H
#define GRPC_CORE_LIB_CENSUS_GRPC_FILTER_H
#ifndef GRPC_CORE_EXT_CENSUS_GRPC_FILTER_H
#define GRPC_CORE_EXT_CENSUS_GRPC_FILTER_H
#include "src/core/lib/channel/channel_stack.h"
@ -41,4 +41,4 @@
extern const grpc_channel_filter grpc_client_census_filter;
extern const grpc_channel_filter grpc_server_census_filter;
#endif /* GRPC_CORE_LIB_CENSUS_GRPC_FILTER_H */
#endif /* GRPC_CORE_EXT_CENSUS_GRPC_FILTER_H */

@ -31,13 +31,11 @@
*
*/
#include "src/core/lib/census/grpc_plugin.h"
#include <limits.h>
#include <grpc/census.h>
#include "src/core/lib/census/grpc_filter.h"
#include "src/core/ext/census/grpc_filter.h"
#include "src/core/lib/channel/channel_stack_builder.h"
#include "src/core/lib/surface/channel_init.h"
@ -67,4 +65,4 @@ void census_grpc_plugin_init(void) {
maybe_add_census_filter, NULL);
}
void census_grpc_plugin_destroy(void) { census_shutdown(); }
void census_grpc_plugin_shutdown(void) { census_shutdown(); }

@ -31,7 +31,7 @@
*
*/
#include "src/core/lib/statistics/hash_table.h"
#include "src/core/ext/census/hash_table.h"
#include <stddef.h>
#include <stdio.h>

@ -31,8 +31,8 @@
*
*/
#ifndef GRPC_CORE_LIB_STATISTICS_HASH_TABLE_H
#define GRPC_CORE_LIB_STATISTICS_HASH_TABLE_H
#ifndef GRPC_CORE_EXT_CENSUS_HASH_TABLE_H
#define GRPC_CORE_EXT_CENSUS_HASH_TABLE_H
#include <stddef.h>
@ -128,4 +128,4 @@ typedef void (*census_ht_itr_cb)(census_ht_key key, const void *val_ptr,
should not invalidate data entries. */
uint64_t census_ht_for_all(const census_ht *ht, census_ht_itr_cb);
#endif /* GRPC_CORE_LIB_STATISTICS_HASH_TABLE_H */
#endif /* GRPC_CORE_EXT_CENSUS_HASH_TABLE_H */

@ -88,7 +88,7 @@
// include the name of the structure, which will be passed as the first
// argument. E.g. cl_block_initialize() will initialize a cl_block.
#include "src/core/lib/census/mlog.h"
#include "src/core/ext/census/mlog.h"
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/cpu.h>

@ -33,8 +33,8 @@
/* A very fast in-memory log, optimized for multiple writers. */
#ifndef GRPC_CORE_LIB_CENSUS_MLOG_H
#define GRPC_CORE_LIB_CENSUS_MLOG_H
#ifndef GRPC_CORE_EXT_CENSUS_MLOG_H
#define GRPC_CORE_EXT_CENSUS_MLOG_H
#include <grpc/support/port_platform.h>
#include <stddef.h>
@ -92,4 +92,4 @@ size_t census_log_remaining_space(void);
out-of-space. */
int64_t census_log_out_of_space_count(void);
#endif /* GRPC_CORE_LIB_CENSUS_MLOG_H */
#endif /* GRPC_CORE_EXT_CENSUS_MLOG_H */

@ -31,8 +31,8 @@
*
*/
#ifndef GRPC_CORE_LIB_CENSUS_RPC_METRIC_ID_H
#define GRPC_CORE_LIB_CENSUS_RPC_METRIC_ID_H
#ifndef GRPC_CORE_EXT_CENSUS_RPC_METRIC_ID_H
#define GRPC_CORE_EXT_CENSUS_RPC_METRIC_ID_H
/* Metric ID's used for RPC measurements. */
/* Count of client requests sent. */
@ -48,4 +48,4 @@
/* Server side request latency. */
#define CENSUS_METRIC_RPC_SERVER_LATENCY ((uint32_t)5)
#endif /* GRPC_CORE_LIB_CENSUS_RPC_METRIC_ID_H */
#endif /* GRPC_CORE_EXT_CENSUS_RPC_METRIC_ID_H */

@ -31,7 +31,7 @@
*
*/
#include "src/core/lib/statistics/window_stats.h"
#include "src/core/ext/census/window_stats.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>

@ -31,8 +31,8 @@
*
*/
#ifndef GRPC_CORE_LIB_STATISTICS_WINDOW_STATS_H
#define GRPC_CORE_LIB_STATISTICS_WINDOW_STATS_H
#ifndef GRPC_CORE_EXT_CENSUS_WINDOW_STATS_H
#define GRPC_CORE_EXT_CENSUS_WINDOW_STATS_H
#include <grpc/support/time.h>
@ -170,4 +170,4 @@ void census_window_stats_get_sums(const struct census_window_stats *wstats,
assertion failure). This function is thread-compatible. */
void census_window_stats_destroy(struct census_window_stats *wstats);
#endif /* GRPC_CORE_LIB_STATISTICS_WINDOW_STATS_H */
#endif /* GRPC_CORE_EXT_CENSUS_WINDOW_STATS_H */

@ -0,0 +1,2 @@
dns: scheme name resolution, using getaddrbyname
(or other OS specific implementation)

@ -31,8 +31,6 @@
*
*/
#include "src/core/lib/client_config/resolvers/dns_resolver.h"
#include <string.h>
#include <grpc/support/alloc.h>
@ -40,6 +38,7 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/client_config/lb_policy_registry.h"
#include "src/core/lib/client_config/resolver_registry.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/support/backoff.h"
@ -277,8 +276,8 @@ static grpc_resolver *dns_factory_create_resolver(
return dns_create(args, "https", "pick_first");
}
char *dns_factory_get_default_host_name(grpc_resolver_factory *factory,
grpc_uri *uri) {
static char *dns_factory_get_default_host_name(grpc_resolver_factory *factory,
grpc_uri *uri) {
const char *path = uri->path;
if (path[0] == '/') ++path;
return gpr_strdup(path);
@ -289,6 +288,12 @@ static const grpc_resolver_factory_vtable dns_factory_vtable = {
dns_factory_get_default_host_name, "dns"};
static grpc_resolver_factory dns_resolver_factory = {&dns_factory_vtable};
grpc_resolver_factory *grpc_dns_resolver_factory_create() {
static grpc_resolver_factory *dns_resolver_factory_create() {
return &dns_resolver_factory;
}
void grpc_resolver_dns_native_init(void) {
grpc_register_resolver_type(dns_resolver_factory_create());
}
void grpc_resolver_dns_native_shutdown(void) {}

@ -0,0 +1 @@
Support for resolving ipv4:, ipv6:, unix: schemes

@ -33,8 +33,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/client_config/resolvers/sockaddr_resolver.h"
#include <stdio.h>
#include <string.h>
@ -43,6 +41,7 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/client_config/lb_policy_registry.h"
#include "src/core/lib/client_config/resolver_registry.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#include "src/core/lib/support/string.h"
@ -343,12 +342,20 @@ static void sockaddr_factory_unref(grpc_resolver_factory *factory) {}
name##_factory_create_resolver, prefix##name##_get_default_authority, \
#name}; \
static grpc_resolver_factory name##_resolver_factory = { \
&name##_factory_vtable}; \
grpc_resolver_factory *grpc_##name##_resolver_factory_create() { \
return &name##_resolver_factory; \
}
&name##_factory_vtable}
#ifdef GPR_HAVE_UNIX_SOCKET
DECL_FACTORY(unix, grpc_)
DECL_FACTORY(unix, grpc_);
#endif
DECL_FACTORY(ipv4, ) DECL_FACTORY(ipv6, )
DECL_FACTORY(ipv4, );
DECL_FACTORY(ipv6, );
void grpc_resolver_sockaddr_init(void) {
grpc_register_resolver_type(&ipv4_resolver_factory);
grpc_register_resolver_type(&ipv6_resolver_factory);
#ifdef GPR_HAVE_UNIX_SOCKET
grpc_register_resolver_type(&unix_resolver_factory);
#endif
}
void grpc_resolver_sockaddr_shutdown(void) {}

@ -0,0 +1 @@
Zookeeper based name resolver: WIP

@ -31,8 +31,6 @@
*
*/
#include "src/core/lib/client_config/resolvers/zookeeper_resolver.h"
#include <string.h>
#include <grpc/support/alloc.h>
@ -474,15 +472,6 @@ static grpc_resolver *zookeeper_create(grpc_resolver_args *args,
return &r->base;
}
static void zookeeper_plugin_init() {
grpc_register_resolver_type(grpc_zookeeper_resolver_factory_create());
}
void grpc_zookeeper_register() {
GRPC_API_TRACE("grpc_zookeeper_register(void)", 0, ());
grpc_register_plugin(zookeeper_plugin_init, NULL);
}
/*
* FACTORY
*/
@ -509,6 +498,15 @@ static const grpc_resolver_factory_vtable zookeeper_factory_vtable = {
static grpc_resolver_factory zookeeper_resolver_factory = {
&zookeeper_factory_vtable};
grpc_resolver_factory *grpc_zookeeper_resolver_factory_create() {
static grpc_resolver_factory *zookeeper_resolver_factory_create() {
return &zookeeper_resolver_factory;
}
static void zookeeper_plugin_init() {
grpc_register_resolver_type(zookeeper_resolver_factory_create());
}
void grpc_zookeeper_register() {
GRPC_API_TRACE("grpc_zookeeper_register(void)", 0, ());
grpc_register_plugin(zookeeper_plugin_init, NULL);
}

@ -40,8 +40,8 @@
#include <grpc/support/slice.h>
#include <grpc/support/slice_buffer.h>
#include "src/core/ext/census/grpc_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/census/grpc_filter.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/client_channel.h"
#include "src/core/lib/channel/compress_filter.h"

@ -70,14 +70,11 @@ void grpc_register_resolver_type(grpc_resolver_factory *factory) {
g_all_of_the_resolvers[g_number_of_resolvers++] = factory;
}
static grpc_resolver_factory *lookup_factory(grpc_uri *uri) {
static grpc_resolver_factory *lookup_factory(const char *name) {
int i;
/* handling NULL uri's here simplifies grpc_resolver_create */
if (!uri) return NULL;
for (i = 0; i < g_number_of_resolvers; i++) {
if (0 == strcmp(uri->scheme, g_all_of_the_resolvers[i]->vtable->scheme)) {
if (0 == strcmp(name, g_all_of_the_resolvers[i]->vtable->scheme)) {
return g_all_of_the_resolvers[i];
}
}
@ -85,6 +82,17 @@ static grpc_resolver_factory *lookup_factory(grpc_uri *uri) {
return NULL;
}
grpc_resolver_factory *grpc_resolver_factory_lookup(const char *name) {
grpc_resolver_factory *f = lookup_factory(name);
if (f) grpc_resolver_factory_ref(f);
return f;
}
static grpc_resolver_factory *lookup_factory_by_uri(grpc_uri *uri) {
if (!uri) return NULL;
return lookup_factory(uri->scheme);
}
static grpc_resolver_factory *resolve_factory(const char *target,
grpc_uri **uri) {
char *tmp;
@ -92,13 +100,13 @@ static grpc_resolver_factory *resolve_factory(const char *target,
GPR_ASSERT(uri != NULL);
*uri = grpc_uri_parse(target, 1);
factory = lookup_factory(*uri);
factory = lookup_factory_by_uri(*uri);
if (factory == NULL) {
if (g_default_resolver_prefix != NULL) {
grpc_uri_destroy(*uri);
gpr_asprintf(&tmp, "%s%s", g_default_resolver_prefix, target);
*uri = grpc_uri_parse(tmp, 1);
factory = lookup_factory(*uri);
factory = lookup_factory_by_uri(*uri);
if (factory == NULL) {
grpc_uri_destroy(grpc_uri_parse(target, 0));
grpc_uri_destroy(grpc_uri_parse(tmp, 0));

@ -58,6 +58,10 @@ void grpc_register_resolver_type(grpc_resolver_factory *factory);
grpc_resolver *grpc_resolver_create(
const char *target, grpc_subchannel_factory *subchannel_factory);
/** Find a resolver factory given a name and return an (owned-by-the-caller)
* reference to it */
grpc_resolver_factory *grpc_resolver_factory_lookup(const char *name);
/** Given a target, return a (freshly allocated with gpr_malloc) string
representing the default authority to pass from a client. */
char *grpc_get_default_authority(const char *target);

@ -1,42 +0,0 @@
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVERS_ZOOKEEPER_RESOLVER_H
#define GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVERS_ZOOKEEPER_RESOLVER_H
#include "src/core/lib/client_config/resolver_factory.h"
/** Create a zookeeper resolver factory */
grpc_resolver_factory *grpc_zookeeper_resolver_factory_create(void);
#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVERS_ZOOKEEPER_RESOLVER_H */

@ -38,8 +38,12 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/slice.h>
#include <grpc/support/slice_buffer.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/support/string.h"
/** a size_t default value... maps to all 1's */
#define NOT_SET (~(size_t)0)
@ -133,6 +137,51 @@ static int parse_fragment_or_query(const char *uri_text, size_t *i) {
return 1;
}
static void do_nothing(void *ignored) {}
static void parse_query_parts(grpc_uri *uri) {
static const char *QUERY_PARTS_SEPARATOR = "&";
static const char *QUERY_PARTS_VALUE_SEPARATOR = "=";
GPR_ASSERT(uri->query != NULL);
if (uri->query[0] == '\0') {
uri->query_parts = NULL;
uri->query_parts_values = NULL;
uri->num_query_parts = 0;
return;
}
gpr_slice query_slice =
gpr_slice_new(uri->query, strlen(uri->query), do_nothing);
gpr_slice_buffer query_parts; /* the &-separated elements of the query */
gpr_slice_buffer query_param_parts; /* the =-separated subelements */
gpr_slice_buffer_init(&query_parts);
gpr_slice_buffer_init(&query_param_parts);
gpr_slice_split(query_slice, QUERY_PARTS_SEPARATOR, &query_parts);
uri->query_parts = gpr_malloc(query_parts.count * sizeof(char *));
uri->query_parts_values = gpr_malloc(query_parts.count * sizeof(char *));
uri->num_query_parts = query_parts.count;
for (size_t i = 0; i < query_parts.count; i++) {
gpr_slice_split(query_parts.slices[i], QUERY_PARTS_VALUE_SEPARATOR,
&query_param_parts);
GPR_ASSERT(query_param_parts.count > 0);
uri->query_parts[i] =
gpr_dump_slice(query_param_parts.slices[0], GPR_DUMP_ASCII);
if (query_param_parts.count > 1) {
/* TODO(dgq): only the first value after the separator is considered.
* Perhaps all chars after the first separator for the query part should
* be included, even if they include the separator. */
uri->query_parts_values[i] =
gpr_dump_slice(query_param_parts.slices[1], GPR_DUMP_ASCII);
} else {
uri->query_parts_values[i] = NULL;
}
gpr_slice_buffer_reset_and_unref(&query_param_parts);
}
gpr_slice_buffer_destroy(&query_parts);
gpr_slice_buffer_destroy(&query_param_parts);
gpr_slice_unref(query_slice);
}
grpc_uri *grpc_uri_parse(const char *uri_text, int suppress_errors) {
grpc_uri *uri;
size_t scheme_begin = 0;
@ -227,16 +276,35 @@ grpc_uri *grpc_uri_parse(const char *uri_text, int suppress_errors) {
uri->path = copy_component(uri_text, path_begin, path_end);
uri->query = copy_component(uri_text, query_begin, query_end);
uri->fragment = copy_component(uri_text, fragment_begin, fragment_end);
parse_query_parts(uri);
return uri;
}
const char *grpc_uri_get_query_arg(const grpc_uri *uri, const char *key) {
GPR_ASSERT(key != NULL);
if (key[0] == '\0') return NULL;
for (size_t i = 0; i < uri->num_query_parts; ++i) {
if (0 == strcmp(key, uri->query_parts[i])) {
return uri->query_parts_values[i];
}
}
return NULL;
}
void grpc_uri_destroy(grpc_uri *uri) {
if (!uri) return;
gpr_free(uri->scheme);
gpr_free(uri->authority);
gpr_free(uri->path);
gpr_free(uri->query);
for (size_t i = 0; i < uri->num_query_parts; ++i) {
gpr_free(uri->query_parts[i]);
gpr_free(uri->query_parts_values[i]);
}
gpr_free(uri->query_parts);
gpr_free(uri->query_parts_values);
gpr_free(uri->fragment);
gpr_free(uri);
}

@ -34,17 +34,29 @@
#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_URI_PARSER_H
#define GRPC_CORE_LIB_CLIENT_CONFIG_URI_PARSER_H
#include <stddef.h>
typedef struct {
char *scheme;
char *authority;
char *path;
char *query;
/** Query substrings separated by '&' */
char **query_parts;
/** Number of elements in \a query_parts and \a query_parts_values */
size_t num_query_parts;
/** Split each query part by '='. NULL if not present. */
char **query_parts_values;
char *fragment;
} grpc_uri;
/** parse a uri, return NULL on failure */
grpc_uri *grpc_uri_parse(const char *uri_text, int suppress_errors);
/** return the part of a query string after the '=' in "?key=xxx&...", or NULL
* if key is not present */
const char *grpc_uri_get_query_arg(const grpc_uri *uri, const char *key);
/** destroy a uri */
void grpc_uri_destroy(grpc_uri *uri);

@ -103,7 +103,8 @@ static void on_connect(grpc_exec_ctx *exec_ctx, void *acp, bool from_iocp) {
GPR_ASSERT(transfered_bytes == 0);
if (!wsa_success) {
char *utf8_message = gpr_format_message(WSAGetLastError());
gpr_log(GPR_ERROR, "on_connect error: %s", utf8_message);
gpr_log(GPR_ERROR, "on_connect error connecting to '%s': %s",
ac->addr_name, utf8_message);
gpr_free(utf8_message);
} else {
*ep = grpc_tcp_create(ac->socket, ac->addr_name);

@ -180,6 +180,13 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader *reader) {
case GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL:
case GRPC_JSON_STATE_VALUE_NUMBER_ZERO:
case GRPC_JSON_STATE_VALUE_NUMBER_EPM:
if (reader->depth == 0) {
return GRPC_JSON_PARSE_ERROR;
} else if ((c == '}') && !reader->in_object) {
return GRPC_JSON_PARSE_ERROR;
} else if ((c == ']') && !reader->in_array) {
return GRPC_JSON_PARSE_ERROR;
}
success = (uint32_t)json_reader_set_number(reader);
if (!success) return GRPC_JSON_PARSE_ERROR;
json_reader_string_clear(reader);
@ -195,8 +202,10 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader *reader) {
}
if (reader->in_object) {
reader->state = GRPC_JSON_STATE_OBJECT_KEY_BEGIN;
} else {
} else if (reader->in_array) {
reader->state = GRPC_JSON_STATE_VALUE_BEGIN;
} else {
return GRPC_JSON_PARSE_ERROR;
}
} else {
if (reader->depth-- == 0) return GRPC_JSON_PARSE_ERROR;

@ -39,9 +39,7 @@
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/time.h>
/* TODO(ctiller): find another way? - better not to include census here */
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/census/grpc_plugin.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/client_channel.h"
#include "src/core/lib/channel/compress_filter.h"
@ -50,8 +48,6 @@
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/client_config/lb_policy_registry.h"
#include "src/core/lib/client_config/resolver_registry.h"
#include "src/core/lib/client_config/resolvers/dns_resolver.h"
#include "src/core/lib/client_config/resolvers/sockaddr_resolver.h"
#include "src/core/lib/client_config/subchannel.h"
#include "src/core/lib/client_config/subchannel_index.h"
#include "src/core/lib/debug/trace.h"
@ -85,8 +81,6 @@ static int g_initializations;
static void do_basic_init(void) {
gpr_mu_init(&g_init_mu);
grpc_register_built_in_plugins();
/* TODO(ctiller): ideally remove this strict linkage */
grpc_register_plugin(census_grpc_plugin_init, census_grpc_plugin_destroy);
g_initializations = 0;
}
@ -169,12 +163,6 @@ void grpc_init(void) {
grpc_channel_init_init();
grpc_lb_policy_registry_init();
grpc_resolver_registry_init(GRPC_DEFAULT_NAME_PREFIX);
grpc_register_resolver_type(grpc_dns_resolver_factory_create());
grpc_register_resolver_type(grpc_ipv4_resolver_factory_create());
grpc_register_resolver_type(grpc_ipv6_resolver_factory_create());
#ifdef GPR_HAVE_UNIX_SOCKET
grpc_register_resolver_type(grpc_unix_resolver_factory_create());
#endif
grpc_register_tracer("api", &grpc_api_trace);
grpc_register_tracer("channel", &grpc_trace_channel);
grpc_register_tracer("http", &grpc_http_trace);

@ -37,10 +37,22 @@ extern void grpc_lb_policy_pick_first_init(void);
extern void grpc_lb_policy_pick_first_shutdown(void);
extern void grpc_lb_policy_round_robin_init(void);
extern void grpc_lb_policy_round_robin_shutdown(void);
extern void grpc_resolver_dns_native_init(void);
extern void grpc_resolver_dns_native_shutdown(void);
extern void grpc_resolver_sockaddr_init(void);
extern void grpc_resolver_sockaddr_shutdown(void);
extern void census_grpc_plugin_init(void);
extern void census_grpc_plugin_shutdown(void);
void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_lb_policy_pick_first_init,
grpc_lb_policy_pick_first_shutdown);
grpc_register_plugin(grpc_lb_policy_round_robin_init,
grpc_lb_policy_round_robin_shutdown);
grpc_register_plugin(grpc_resolver_dns_native_init,
grpc_resolver_dns_native_shutdown);
grpc_register_plugin(grpc_resolver_sockaddr_init,
grpc_resolver_sockaddr_shutdown);
grpc_register_plugin(census_grpc_plugin_init,
census_grpc_plugin_shutdown);
}

@ -33,14 +33,26 @@
#include <grpc/grpc.h>
extern void grpc_resolver_dns_native_init(void);
extern void grpc_resolver_dns_native_shutdown(void);
extern void grpc_resolver_sockaddr_init(void);
extern void grpc_resolver_sockaddr_shutdown(void);
extern void grpc_lb_policy_pick_first_init(void);
extern void grpc_lb_policy_pick_first_shutdown(void);
extern void grpc_lb_policy_round_robin_init(void);
extern void grpc_lb_policy_round_robin_shutdown(void);
extern void census_grpc_plugin_init(void);
extern void census_grpc_plugin_shutdown(void);
void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_resolver_dns_native_init,
grpc_resolver_dns_native_shutdown);
grpc_register_plugin(grpc_resolver_sockaddr_init,
grpc_resolver_sockaddr_shutdown);
grpc_register_plugin(grpc_lb_policy_pick_first_init,
grpc_lb_policy_pick_first_shutdown);
grpc_register_plugin(grpc_lb_policy_round_robin_init,
grpc_lb_policy_round_robin_shutdown);
grpc_register_plugin(census_grpc_plugin_init,
census_grpc_plugin_shutdown);
}

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit.Runners" version="2.6.4" />
<package id="OpenCover" version="4.6.166" />
<package id="ReportGenerator" version="2.3.2.0" />
<package id="OpenCover" version="4.6.519" />
<package id="ReportGenerator" version="2.4.4.0" />
</packages>

@ -9,7 +9,7 @@
<AssemblyName>Grpc.Auth</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<DocumentationFile>bin\$(Configuration)\Grpc.Auth.Xml</DocumentationFile>
<NuGetPackageImportStamp>4f8487a9</NuGetPackageImportStamp>
<NuGetPackageImportStamp>455903a2</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -39,43 +39,30 @@
<AssemblyOriginatorKeyFile>..\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Google.Apis.Auth, Version=1.10.0.25333, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<Reference Include="BouncyCastle.Crypto, Version=1.7.4137.9688, Culture=neutral, PublicKeyToken=a4292a325f69b123, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Auth.1.10.0\lib\net40\Google.Apis.Auth.dll</HintPath>
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.10.0.25333, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<Reference Include="Google.Apis.Core, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Auth.1.10.0\lib\net40\Google.Apis.Auth.PlatformServices.dll</HintPath>
<HintPath>..\packages\Google.Apis.Core.1.11.1\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Core, Version=1.10.0.25331, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Core.1.10.0\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="BouncyCastle.Crypto">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Extensions">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
@ -93,15 +80,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Grpc.Auth.nuspec" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
</Target>
</Project>

@ -15,7 +15,7 @@
<copyright>Copyright 2015, Google Inc.</copyright>
<tags>gRPC RPC Protocol HTTP/2 Auth OAuth2</tags>
<dependencies>
<dependency id="Google.Apis.Auth" version="1.9.3" />
<dependency id="Google.Apis.Auth" version="1.11.1" />
<dependency id="Grpc.Core" version="$version$" />
</dependencies>
</metadata>

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.29.0" newVersion="4.2.29.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.28.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.9.2.38523" newVersion="1.9.2.38523" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -1,11 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.10.0" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.10.0" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.11.1" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.11.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
</packages>

@ -93,6 +93,7 @@
<Compile Include="MetadataTest.cs" />
<Compile Include="PerformanceTest.cs" />
<Compile Include="SanityTest.cs" />
<Compile Include="HalfcloseTest.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

@ -0,0 +1,97 @@
#region Copyright notice and license
// Copyright 2016, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Internal;
using Grpc.Core.Utils;
using NUnit.Framework;
namespace Grpc.Core.Tests
{
public class HalfcloseTest
{
MockServiceHelper helper;
Server server;
Channel channel;
[SetUp]
public void Init()
{
helper = new MockServiceHelper();
server = helper.GetServer();
server.Start();
channel = helper.GetChannel();
}
[TearDown]
public void Cleanup()
{
channel.ShutdownAsync().Wait();
server.ShutdownAsync().Wait();
}
/// <summary>
/// For client streaming and duplex streaming calls, if server does a full close
/// before we halfclose the request stream, an attempt to halfclose
/// (complete the request stream) shouldn't be treated as an error.
/// </summary>
[Test]
public async Task HalfcloseAfterFullclose_ClientStreamingCall()
{
helper.ClientStreamingHandler = new ClientStreamingServerMethod<string, string>(async (requestStream, context) =>
{
return "PASS";
});
var call = Calls.AsyncClientStreamingCall(helper.CreateClientStreamingCall());
// make sure server has fullclosed on us
Assert.AreEqual("PASS", await call.ResponseAsync);
// sending close from client should be still fine because server can finish
// the call anytime and we cannot do anything about it on the client side.
await call.RequestStream.CompleteAsync();
// Second attempt to close from client is not allowed.
Assert.Throws(typeof(InvalidOperationException), async () => await call.RequestStream.CompleteAsync());
}
}
}

@ -74,6 +74,8 @@ namespace Grpc.Core.Tests
/// (~110ns .NET Windows)
/// </summary>
[Test]
[Category("Performance")]
[Ignore("Prevent running on Jenkins")]
public void NativeCallbackBenchmark()
{
OpCompletionDelegate handler = Handler;
@ -95,6 +97,8 @@ namespace Grpc.Core.Tests
/// (~1.1us on .NET Windows)
/// </summary>
[Test]
[Category("Performance")]
[Ignore("Prevent running on Jenkins")]
public void NewNativeCallbackBenchmark()
{
counter = 0;
@ -112,6 +116,8 @@ namespace Grpc.Core.Tests
/// (~46ns .NET Windows)
/// </summary>
[Test]
[Category("Performance")]
[Ignore("Prevent running on Jenkins")]
public void NopPInvokeBenchmark()
{
BenchmarkUtil.RunBenchmark(

@ -258,9 +258,19 @@ namespace Grpc.Core.Internal
lock (myLock)
{
GrpcPreconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
CheckSendingAllowed();
CheckSendingAllowed(allowFinished: true);
call.StartSendCloseFromClient(HandleHalfclosed);
if (!disposed && !finished)
{
call.StartSendCloseFromClient(HandleSendCloseFromClientFinished);
}
else
{
// In case the call has already been finished by the serverside,
// the halfclose has already been done implicitly, so we only
// emit the notification for the completion delegate.
Task.Run(() => HandleSendCloseFromClientFinished(true));
}
halfcloseRequested = true;
sendCompletionDelegate = completionDelegate;

@ -136,7 +136,7 @@ namespace Grpc.Core.Internal
lock (myLock)
{
GrpcPreconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
CheckSendingAllowed();
CheckSendingAllowed(allowFinished: false);
call.StartSendMessage(HandleSendFinished, payload, writeFlags, !initialMetadataSent);
@ -202,14 +202,14 @@ namespace Grpc.Core.Internal
{
}
protected void CheckSendingAllowed()
protected void CheckSendingAllowed(bool allowFinished)
{
GrpcPreconditions.CheckState(started);
CheckNotCancelled();
GrpcPreconditions.CheckState(!disposed);
GrpcPreconditions.CheckState(!disposed || allowFinished);
GrpcPreconditions.CheckState(!halfcloseRequested, "Already halfclosed.");
GrpcPreconditions.CheckState(!finished, "Already finished.");
GrpcPreconditions.CheckState(!finished || allowFinished, "Already finished.");
GrpcPreconditions.CheckState(sendCompletionDelegate == null, "Only one write can be pending at a time");
}
@ -294,9 +294,33 @@ namespace Grpc.Core.Internal
}
/// <summary>
/// Handles halfclose completion.
/// Handles halfclose (send close from client) completion.
/// </summary>
protected void HandleSendCloseFromClientFinished(bool success)
{
AsyncCompletionDelegate<object> origCompletionDelegate = null;
lock (myLock)
{
origCompletionDelegate = sendCompletionDelegate;
sendCompletionDelegate = null;
ReleaseResourcesIfPossible();
}
if (!success)
{
FireCompletion(origCompletionDelegate, null, new InvalidOperationException("Sending close from client has failed."));
}
else
{
FireCompletion(origCompletionDelegate, null, null);
}
}
/// <summary>
/// Handles send status from server completion.
/// </summary>
protected void HandleHalfclosed(bool success)
protected void HandleSendStatusFromServerFinished(bool success)
{
AsyncCompletionDelegate<object> origCompletionDelegate = null;
lock (myLock)
@ -309,7 +333,7 @@ namespace Grpc.Core.Internal
if (!success)
{
FireCompletion(origCompletionDelegate, null, new InvalidOperationException("Halfclose failed"));
FireCompletion(origCompletionDelegate, null, new InvalidOperationException("Error sending status from server."));
}
else
{

@ -113,7 +113,7 @@ namespace Grpc.Core.Internal
GrpcPreconditions.CheckState(!initialMetadataSent, "Response headers can only be sent once per call.");
GrpcPreconditions.CheckState(streamingWritesCounter == 0, "Response headers can only be sent before the first write starts.");
CheckSendingAllowed();
CheckSendingAllowed(allowFinished: false);
GrpcPreconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
@ -137,11 +137,11 @@ namespace Grpc.Core.Internal
lock (myLock)
{
GrpcPreconditions.CheckNotNull(completionDelegate, "Completion delegate cannot be null");
CheckSendingAllowed();
CheckSendingAllowed(allowFinished: false);
using (var metadataArray = MetadataArraySafeHandle.Create(trailers))
{
call.StartSendStatusFromServer(HandleHalfclosed, status, metadataArray, !initialMetadataSent);
call.StartSendStatusFromServer(HandleSendStatusFromServerFinished, status, metadataArray, !initialMetadataSent);
}
halfcloseRequested = true;
readingDone = true;

@ -9,7 +9,7 @@
<AssemblyName>Grpc.IntegrationTesting.Client</AssemblyName>
<StartupObject>Grpc.IntegrationTesting.Client.Program</StartupObject>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<NuGetPackageImportStamp>6d22e68f</NuGetPackageImportStamp>
<NuGetPackageImportStamp>dfa56e6c</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -43,28 +43,17 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth, Version=1.10.0.25333, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<Reference Include="Google.Apis.Auth, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Auth.1.10.0\lib\net40\Google.Apis.Auth.dll</HintPath>
<HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.10.0.25333, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Auth.1.10.0\lib\net40\Google.Apis.Auth.PlatformServices.dll</HintPath>
<HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Core, Version=1.10.0.25331, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<Reference Include="Google.Apis.Core, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Core.1.10.0\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
<HintPath>..\packages\Google.Apis.Core.1.11.1\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@ -73,12 +62,6 @@
<Reference Include="System" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Extensions">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
</ItemGroup>
<ItemGroup>
@ -100,14 +83,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
</Target>
</Project>

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.29.0" newVersion="4.2.29.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.28.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.9.2.38523" newVersion="1.9.2.38523" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -1,11 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.10.0" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.10.0" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.11.1" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.11.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
</packages>

@ -6,6 +6,10 @@
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.29.0" newVersion="4.2.29.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.11.1.0" newVersion="1.11.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -9,7 +9,7 @@
<AssemblyName>Grpc.IntegrationTesting.Server</AssemblyName>
<StartupObject>Grpc.IntegrationTesting.Server.Program</StartupObject>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<NuGetPackageImportStamp>d9ee8e52</NuGetPackageImportStamp>
<NuGetPackageImportStamp>7ceb739e</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -43,28 +43,17 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth, Version=1.10.0.25333, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<Reference Include="Google.Apis.Auth, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Auth.1.10.0\lib\net40\Google.Apis.Auth.dll</HintPath>
<HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.10.0.25333, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Auth.1.10.0\lib\net40\Google.Apis.Auth.PlatformServices.dll</HintPath>
<HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Core, Version=1.10.0.25331, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<Reference Include="Google.Apis.Core, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Core.1.10.0\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
<HintPath>..\packages\Google.Apis.Core.1.11.1\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@ -73,12 +62,6 @@
<Reference Include="System" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Extensions">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives">
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
</ItemGroup>
<ItemGroup>
@ -100,14 +83,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
</Target>
</Project>

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.29.0" newVersion="4.2.29.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.28.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.9.2.38523" newVersion="1.9.2.38523" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -1,11 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.10.0" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.10.0" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.11.1" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.11.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
</packages>

@ -8,7 +8,7 @@
<RootNamespace>Grpc.IntegrationTesting</RootNamespace>
<AssemblyName>Grpc.IntegrationTesting</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<NuGetPackageImportStamp>6566287f</NuGetPackageImportStamp>
<NuGetPackageImportStamp>3a1c655d</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -38,20 +38,24 @@
<AssemblyOriginatorKeyFile>..\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.7.4137.9688, Culture=neutral, PublicKeyToken=a4292a325f69b123, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="CommandLine">
<HintPath>..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth, Version=1.10.0.25333, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<Reference Include="Google.Apis.Auth, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Auth.1.10.0\lib\net40\Google.Apis.Auth.dll</HintPath>
<HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.10.0.25333, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<Reference Include="Google.Apis.Auth.PlatformServices, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Auth.1.10.0\lib\net40\Google.Apis.Auth.PlatformServices.dll</HintPath>
<HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Core, Version=1.10.0.25331, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<Reference Include="Google.Apis.Core, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Google.Apis.Core.1.10.0\lib\portable-net40+sl50+win+wpa81+wp80\Google.Apis.Core.dll</HintPath>
<HintPath>..\packages\Google.Apis.Core.1.11.1\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@ -60,6 +64,10 @@
<Reference Include="Moq">
<HintPath>..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
@ -71,21 +79,6 @@
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="BouncyCastle.Crypto">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
@ -134,8 +127,9 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="data\README">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@ -152,11 +146,4 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
</Target>
</Project>

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.29.0" newVersion="4.2.29.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.28.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.9.2.38523" newVersion="1.9.2.38523" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -2,14 +2,10 @@
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
<package id="CommandLineParser" version="1.9.71" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.10.0" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.10.0" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.11.1" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.11.1" targetFramework="net45" />
<package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" />
<package id="Ix-Async" version="1.2.5" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net45" />
<package id="Moq" version="4.2.1510.2205" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="NUnit" version="2.6.4" targetFramework="net45" />

@ -21,6 +21,7 @@
"Grpc.Core.Tests.CompressionTest",
"Grpc.Core.Tests.ContextPropagationTest",
"Grpc.Core.Tests.GrpcEnvironmentTest",
"Grpc.Core.Tests.HalfcloseTest",
"Grpc.Core.Tests.MarshallingErrorsTest",
"Grpc.Core.Tests.MetadataTest",
"Grpc.Core.Tests.NUnitVersionTest",

@ -545,6 +545,8 @@ var test_cases = {
Client: testProto.TestService}
};
exports.test_cases = test_cases;
/**
* Execute a single test case.
* @param {string} address The address of the server to connect to, in the

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -31,20 +31,31 @@
*
*/
#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVERS_SOCKADDR_RESOLVER_H
#define GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVERS_SOCKADDR_RESOLVER_H
'use strict';
#include <grpc/support/port_platform.h>
var grpc = require('../../..');
#include "src/core/lib/client_config/resolver_factory.h"
var proto = grpc.load(__dirname + '/../../proto/grpc/testing/metrics.proto');
var metrics = proto.grpc.testing;
grpc_resolver_factory *grpc_ipv4_resolver_factory_create(void);
function main() {
var parseArgs = require('minimist');
var argv = parseArgs(process.argv, {
string: 'metrics_server_address',
boolean: 'total_only'
});
var client = new metrics.MetricsService(argv.metrics_server_address,
grpc.credentials.createInsecure());
if (argv.total_only) {
client.getGauge({name: 'qps'}, function(err, data) {
console.log(data.name + ':', data.long_value);
});
} else {
var call = client.getAllGauges({});
call.on('data', function(data) {
console.log(data.name + ':', data.long_value);
});
}
}
grpc_resolver_factory *grpc_ipv6_resolver_factory_create(void);
#ifdef GPR_POSIX_SOCKET
/** Create a unix resolver factory */
grpc_resolver_factory *grpc_unix_resolver_factory_create(void);
#endif
#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVERS_SOCKADDR_RESOLVER_H */
main();

@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -31,12 +31,57 @@
*
*/
#ifndef GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVERS_DNS_RESOLVER_H
#define GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVERS_DNS_RESOLVER_H
'use strict';
#include "src/core/lib/client_config/resolver_factory.h"
var _ = require('lodash');
/** Create a dns resolver factory */
grpc_resolver_factory *grpc_dns_resolver_factory_create(void);
var grpc = require('../../..');
#endif /* GRPC_CORE_LIB_CLIENT_CONFIG_RESOLVERS_DNS_RESOLVER_H */
var proto = grpc.load(__dirname + '/../../proto/grpc/testing/metrics.proto');
var metrics = proto.grpc.testing;
function getGauge(call, callback) {
/* jshint validthis: true */
// Should be bound to a MetricsServer object
var name = call.request.name;
if (this.gauges.hasOwnProperty(name)) {
callback(null, _.assign({name: name}, this.gauges[name]()));
} else {
callback({code: grpc.status.NOT_FOUND,
details: 'No such gauge: ' + name});
}
}
function getAllGauges(call) {
/* jshint validthis: true */
// Should be bound to a MetricsServer object
_.each(this.gauges, function(getter, name) {
call.write(_.assign({name: name}, getter()));
});
call.end();
}
function MetricsServer(port) {
var server = new grpc.Server();
server.addProtoService(metrics.MetricsService.service, {
getGauge: _.bind(getGauge, this),
getAllGauges: _.bind(getAllGauges, this)
});
server.bind('localhost:' + port, grpc.ServerCredentials.createInsecure());
this.server = server;
this.gauges = {};
}
MetricsServer.prototype.start = function() {
this.server.start();
}
MetricsServer.prototype.registerGauge = function(name, getter) {
this.gauges[name] = getter;
};
MetricsServer.prototype.shutdown = function() {
this.server.forceShutdown();
};
module.exports = MetricsServer;

@ -0,0 +1,126 @@
/*
*
* Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
'use strict';
var _ = require('lodash');
var grpc = require('../../..');
var interop_client = require('../interop/interop_client');
var MetricsServer = require('./metrics_server');
var running;
var metrics_server;
var start_time;
var query_count;
function makeCall(client, test_cases) {
if (!running) {
return;
}
var test_case = test_cases[_.random(test_cases.length - 1)];
interop_client.test_cases[test_case].run(client, function() {
query_count += 1;
makeCall(client, test_cases);
});
}
function makeCalls(client, test_cases, parallel_calls_per_channel) {
_.times(parallel_calls_per_channel, function() {
makeCall(client, test_cases);
});
}
function getQps() {
var diff = process.hrtime(start_time);
var seconds = diff[0] + diff[1] / 1e9;
return {long_value: query_count / seconds};
}
function start(server_addresses, test_cases, channels_per_server,
parallel_calls_per_channel, metrics_port) {
running = true;
/* Assuming that we are not calling unimplemented_method. The client class
* used by empty_unary is (currently) the client class used by every interop
* test except unimplemented_method */
var Client = interop_client.test_cases.empty_unary.Client;
/* Make channels_per_server clients connecting to each server address */
var channels = _.flatten(_.times(
channels_per_server, _.partial(_.map, server_addresses, function(address) {
return new Client(address, grpc.credentials.createInsecure());
})));
metrics_server = new MetricsServer(metrics_port);
metrics_server.registerGauge('qps', getQps);
start_time = process.hrtime();
query_count = 0;
_.each(channels, _.partial(makeCalls, _, test_cases,
parallel_calls_per_channel));
metrics_server.start();
}
function stop() {
running = false;
metrics_server.shutdown();
console.log('QPS: ' + getQps().long_value);
}
function main() {
var parseArgs = require('minimist');
var argv = parseArgs(process.argv, {
string: ['server_addresses', 'test_cases', 'metrics_port'],
default: {'server_addresses': 'localhost:8080',
'test_duration-secs': -1,
'num_channels_per_server': 1,
'num_stubs_per_channel': 1,
'metrics_port': '8081'}
});
var server_addresses = argv.server_addresses.split(',');
/* Generate an array of test cases, where the number of instances of each name
* corresponds to the number given in the argument.
* e.g. 'empty_unary:1,large_unary:2' =>
* ['empty_unary', 'large_unary', 'large_unary'] */
var test_cases = _.flatten(_.map(argv.test_cases.split(','), function(value) {
var split = value.split(':');
return _.times(split[1], _.constant(split[0]));
}));
start(server_addresses, test_cases, argv.num_channels_per_server,
argv.num_stubs_per_channel, argv.metrics_port);
if (argv['test_duration-secs'] > -1) {
setTimeout(stop, argv['test_duration-secs'] * 1000);
}
}
main();

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc.
# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -61,15 +61,16 @@ class ChannelCredentials(object):
self._low_credentials = low_credentials
def ssl_channel_credentials(root_certificates, private_key, certificate_chain):
def ssl_channel_credentials(root_certificates=None, private_key=None,
certificate_chain=None):
"""Creates a ChannelCredentials for use with an SSL-enabled Channel.
Args:
root_certificates: The PEM-encoded root certificates or None to ask for
root_certificates: The PEM-encoded root certificates or unset to ask for
them to be retrieved from a default location.
private_key: The PEM-encoded private key to use or None if no private key
private_key: The PEM-encoded private key to use or unset if no private key
should be used.
certificate_chain: The PEM-encoded certificate chain to use or None if no
certificate_chain: The PEM-encoded certificate chain to use or unset if no
certificate chain should be used.
Returns:

@ -74,10 +74,21 @@ CORE_SOURCE_FILES = [
'src/core/lib/support/tmpfile_posix.c',
'src/core/lib/support/tmpfile_win32.c',
'src/core/lib/support/wrap_memcpy.c',
'src/core/ext/census/context.c',
'src/core/ext/census/grpc_context.c',
'src/core/ext/census/grpc_filter.c',
'src/core/ext/census/grpc_plugin.c',
'src/core/ext/census/initialize.c',
'src/core/ext/census/mlog.c',
'src/core/ext/census/operation.c',
'src/core/ext/census/placeholders.c',
'src/core/ext/census/tracing.c',
'src/core/ext/lb_policy/grpclb/load_balancer_api.c',
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c',
'src/core/ext/lb_policy/pick_first/pick_first.c',
'src/core/ext/lb_policy/round_robin/round_robin.c',
'src/core/ext/resolver/dns/native/dns_resolver.c',
'src/core/ext/resolver/sockaddr/sockaddr_resolver.c',
'src/core/ext/transport/chttp2/client/insecure/channel_create.c',
'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',
@ -103,15 +114,6 @@ CORE_SOURCE_FILES = [
'src/core/ext/transport/chttp2/transport/timeout_encoding.c',
'src/core/ext/transport/chttp2/transport/varint.c',
'src/core/ext/transport/chttp2/transport/writing.c',
'src/core/lib/census/context.c',
'src/core/lib/census/grpc_context.c',
'src/core/lib/census/grpc_filter.c',
'src/core/lib/census/grpc_plugin.c',
'src/core/lib/census/initialize.c',
'src/core/lib/census/mlog.c',
'src/core/lib/census/operation.c',
'src/core/lib/census/placeholders.c',
'src/core/lib/census/tracing.c',
'src/core/lib/channel/channel_args.c',
'src/core/lib/channel/channel_stack.c',
'src/core/lib/channel/channel_stack_builder.c',
@ -131,8 +133,6 @@ CORE_SOURCE_FILES = [
'src/core/lib/client_config/resolver.c',
'src/core/lib/client_config/resolver_factory.c',
'src/core/lib/client_config/resolver_registry.c',
'src/core/lib/client_config/resolvers/dns_resolver.c',
'src/core/lib/client_config/resolvers/sockaddr_resolver.c',
'src/core/lib/client_config/subchannel.c',
'src/core/lib/client_config/subchannel_factory.c',
'src/core/lib/client_config/subchannel_index.c',

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc.
# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -56,7 +56,7 @@ class SecureInteropTest(
self.stub = test_pb2.beta_create_TestService_stub(
test_utilities.not_really_secure_channel(
'[::]', port, implementations.ssl_channel_credentials(
resources.test_root_certificates(), None, None),
resources.test_root_certificates()),
_SERVER_HOST_OVERRIDE))
def tearDown(self):

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc.
# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -94,7 +94,7 @@ def _stub(args):
channel = test_utilities.not_really_secure_channel(
args.server_host, args.server_port,
implementations.ssl_channel_credentials(root_certificates, None, None),
implementations.ssl_channel_credentials(root_certificates),
args.server_host_override)
stub = test_pb2.beta_create_TestService_stub(
channel, metadata_transformer=metadata_transformer)

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc.
# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -183,7 +183,7 @@ class BetaFeaturesTest(unittest.TestCase):
port = self._server.add_secure_port('[::]:0', server_credentials)
self._server.start()
self._channel_credentials = implementations.ssl_channel_credentials(
resources.test_root_certificates(), None, None)
resources.test_root_certificates())
self._call_credentials = implementations.metadata_call_credentials(
_metadata_plugin)
channel = test_utilities.not_really_secure_channel(
@ -296,7 +296,7 @@ class ContextManagementAndLifecycleTest(unittest.TestCase):
self._server_credentials = implementations.ssl_server_credentials(
[(resources.private_key(), resources.certificate_chain(),),])
self._channel_credentials = implementations.ssl_channel_credentials(
resources.test_root_certificates(), None, None)
resources.test_root_certificates())
self._stub_options = implementations.stub_options(
thread_pool_size=test_constants.POOL_SIZE)

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc.
# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -94,7 +94,7 @@ class _Implementation(test_interfaces.Implementation):
port = server.add_secure_port('[::]:0', server_credentials)
server.start()
channel_credentials = implementations.ssl_channel_credentials(
resources.test_root_certificates(), None, None)
resources.test_root_certificates())
channel = test_utilities.not_really_secure_channel(
'localhost', port, channel_credentials, _SERVER_HOST_OVERRIDE)
stub_options = implementations.stub_options(

@ -38,14 +38,13 @@ from tests.unit import resources
class ChannelCredentialsTest(unittest.TestCase):
def test_runtime_provided_root_certificates(self):
channel_credentials = implementations.ssl_channel_credentials(
None, None, None)
channel_credentials = implementations.ssl_channel_credentials()
self.assertIsInstance(
channel_credentials, implementations.ChannelCredentials)
def test_application_provided_root_certificates(self):
channel_credentials = implementations.ssl_channel_credentials(
resources.test_root_certificates(), None, None)
resources.test_root_certificates())
self.assertIsInstance(
channel_credentials, implementations.ChannelCredentials)

@ -40,11 +40,18 @@ $PROTOC -I src/proto src/proto/grpc/health/v1/health.proto \
--ruby_out=src/ruby/pb \
--plugin=$PLUGIN
$PROTOC -I . test/proto/{messages,test,empty}.proto \
$PROTOC -I . \
src/proto/grpc/testing/{messages,test,empty}.proto \
--grpc_out=src/ruby/pb \
--ruby_out=src/ruby/pb \
--plugin=$PLUGIN
$PROTOC -I . \
src/proto/grpc/testing/{messages,payloads,stats,services,control}.proto \
--grpc_out=src/ruby/qps \
--ruby_out=src/ruby/qps \
--plugin=$PLUGIN
$PROTOC -I src/proto/math src/proto/math/math.proto \
--grpc_out=src/ruby/bin \
--ruby_out=src/ruby/bin \

@ -0,0 +1,164 @@
#!/usr/bin/env ruby
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Worker and worker service implementation
this_dir = File.expand_path(File.dirname(__FILE__))
lib_dir = File.join(File.dirname(this_dir), 'lib')
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
$LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir)
require 'grpc'
require 'histogram'
require 'src/proto/grpc/testing/services_services'
class Poisson
def interarrival
@lambda_recip * (-Math.log(1.0-rand))
end
def advance
t = @next_time
@next_time += interarrival
t
end
def initialize(lambda)
@lambda_recip = 1.0/lambda
@next_time = Time.now + interarrival
end
end
class BenchmarkClient
def initialize(config)
opts = {}
if config.security_params
if config.security_params.use_test_ca
certs = load_test_certs
cred = GRPC::Core::ChannelCredentials.new(certs[0])
else
cred = GRPC::Core::ChannelCredentials.new()
end
if config.security_params.server_host_override
opts[GRPC::Core::Channel::SSL_TARGET] =
config.security_params.server_host_override
end
else
cred = :this_channel_is_insecure
end
@histres = config.histogram_params.resolution
@histmax = config.histogram_params.max_possible
@start_time = Time.now
@histogram = Histogram.new(@histres, @histmax)
@done = false
gtsr = Grpc::Testing::SimpleRequest
gtpt = Grpc::Testing::PayloadType
gtp = Grpc::Testing::Payload
simple_params = config.payload_config.simple_params
req = gtsr.new(response_type: gtpt::COMPRESSABLE,
response_size: simple_params.resp_size,
payload: gtp.new(type: gtpt::COMPRESSABLE,
body: nulls(simple_params.req_size)))
(0..config.client_channels-1).each do |chan|
gtbss = Grpc::Testing::BenchmarkService::Stub
st = config.server_targets
stub = gtbss.new(st[chan % st.length], cred, **opts)
(0..config.outstanding_rpcs_per_channel-1).each do |r|
Thread.new {
case config.load_params.load.to_s
when 'closed_loop'
waiter = nil
when 'poisson'
waiter = Poisson.new(config.load_params.poisson.offered_load /
(config.client_channels *
config.outstanding_rpcs_per_channel))
end
case config.rpc_type
when :UNARY
unary_ping_ponger(req,stub,config,waiter)
when :STREAMING
streaming_ping_ponger(req,stub,config,waiter)
end
}
end
end
end
def wait_to_issue(waiter)
if waiter
delay = waiter.advance-Time.now
sleep delay if delay > 0
end
end
def unary_ping_ponger(req, stub, config,waiter)
while !@done
wait_to_issue(waiter)
start = Time.now
resp = stub.unary_call(req)
@histogram.add((Time.now-start)*1e9)
end
end
def streaming_ping_ponger(req, stub, config, waiter)
q = EnumeratorQueue.new(self)
resp = stub.streaming_call(q.each_item)
start = Time.now
q.push(req)
resp.each do |r|
@histogram.add((Time.now-start)*1e9)
if !@done
wait_to_issue(waiter)
start = Time.now
q.push(req)
else
q.push(self)
break
end
end
end
def mark(reset)
lat = Grpc::Testing::HistogramData.new(
bucket: @histogram.contents,
min_seen: @histogram.minimum,
max_seen: @histogram.maximum,
sum: @histogram.sum,
sum_of_squares: @histogram.sum_of_squares,
count: @histogram.count
)
elapsed = Time.now-@start_time
if reset
@start_time = Time.now
@histogram = Histogram.new(@histres, @histmax)
end
Grpc::Testing::ClientStats.new(latencies: lat, time_elapsed: elapsed)
end
def shutdown
@done = true
end
end

@ -0,0 +1,88 @@
#!/usr/bin/env ruby
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Histogram class for use in performance testing and measurement
class Histogram
# Determine the bucket index for a given value
# @param {number} value The value to check
# @return {number} The bucket index
def bucket_for(value)
(Math.log(value)/Math.log(@multiplier)).to_i
end
# Initialize an empty histogram
# @param {number} resolution The resolution of the histogram
# @param {number} max_possible The maximum value for the histogram
def initialize(resolution, max_possible)
@resolution=resolution
@max_possible=max_possible
@sum=0
@sum_of_squares=0
@multiplier=1+resolution
@count=0
@min_seen=max_possible
@max_seen=0
@buckets=Array.new(bucket_for(max_possible)+1, 0)
end
# Add a value to the histogram. This updates all statistics with the new
# value. Those statistics should not be modified except with this function
# @param {number} value The value to add
def add(value)
@sum += value
@sum_of_squares += value * value
@count += 1
if value < @min_seen
@min_seen = value
end
if value > @max_seen
@max_seen = value
end
@buckets[bucket_for(value)] += 1
end
def minimum
@min_seen
end
def maximum
@max_seen
end
def sum
@sum
end
def sum_of_squares
@sum_of_squares
end
def count
@count
end
def contents
@buckets
end
end

@ -0,0 +1,76 @@
#!/usr/bin/env ruby
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Worker and worker service implementation
this_dir = File.expand_path(File.dirname(__FILE__))
lib_dir = File.join(File.dirname(this_dir), 'lib')
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
$LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir)
require 'grpc'
# produces a string of null chars (\0 aka pack 'x') of length l.
def nulls(l)
fail 'requires #{l} to be +ve' if l < 0
[].pack('x' * l).force_encoding('ascii-8bit')
end
# load the test-only certificates
def load_test_certs
this_dir = File.expand_path(File.dirname(__FILE__))
data_dir = File.join(File.dirname(this_dir), 'spec/testdata')
files = ['ca.pem', 'server1.key', 'server1.pem']
files.map { |f| File.open(File.join(data_dir, f)).read }
end
# A EnumeratorQueue wraps a Queue yielding the items added to it via each_item.
class EnumeratorQueue
extend Forwardable
def_delegators :@q, :push
def initialize(sentinel)
@q = Queue.new
@sentinel = sentinel
end
def each_item
return enum_for(:each_item) unless block_given?
loop do
r = @q.pop
break if r.equal?(@sentinel)
fail r if r.is_a? Exception
yield r
end
end
end

@ -0,0 +1,91 @@
#!/usr/bin/env ruby
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Worker and worker service implementation
this_dir = File.expand_path(File.dirname(__FILE__))
lib_dir = File.join(File.dirname(this_dir), 'lib')
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
$LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir)
require 'grpc'
require 'qps-common'
require 'src/proto/grpc/testing/messages'
require 'src/proto/grpc/testing/services_services'
require 'src/proto/grpc/testing/stats'
class BenchmarkServiceImpl < Grpc::Testing::BenchmarkService::Service
def unary_call(req, _call)
sr = Grpc::Testing::SimpleResponse
pl = Grpc::Testing::Payload
sr.new(payload: pl.new(body: nulls(req.response_size)))
end
def streaming_call(reqs)
q = EnumeratorQueue.new(self)
Thread.new {
sr = Grpc::Testing::SimpleResponse
pl = Grpc::Testing::Payload
reqs.each do |req|
q.push(sr.new(payload: pl.new(body: nulls(req.response_size))))
end
q.push(self)
}
q.each_item
end
end
class BenchmarkServer
def initialize(config, port)
if config.security_params
certs = load_test_certs
cred = GRPC::Core::ServerCredentials.new(
nil, [{private_key: certs[1], cert_chain: certs[2]}], false)
else
cred = :this_port_is_insecure
end
@server = GRPC::RpcServer.new
@port = @server.add_http2_port("0.0.0.0:" + port.to_s, cred)
@server.handle(BenchmarkServiceImpl.new)
@start_time = Time.now
Thread.new {
@server.run
}
end
def mark(reset)
s = Grpc::Testing::ServerStats.new(time_elapsed:
(Time.now-@start_time).to_f)
@start_time = Time.now if reset
s
end
def get_port
@port
end
end

@ -0,0 +1,129 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: src/proto/grpc/testing/control.proto
require 'google/protobuf'
require 'src/proto/grpc/testing/payloads'
require 'src/proto/grpc/testing/stats'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "grpc.testing.PoissonParams" do
optional :offered_load, :double, 1
end
add_message "grpc.testing.UniformParams" do
optional :interarrival_lo, :double, 1
optional :interarrival_hi, :double, 2
end
add_message "grpc.testing.DeterministicParams" do
optional :offered_load, :double, 1
end
add_message "grpc.testing.ParetoParams" do
optional :interarrival_base, :double, 1
optional :alpha, :double, 2
end
add_message "grpc.testing.ClosedLoopParams" do
end
add_message "grpc.testing.LoadParams" do
oneof :load do
optional :closed_loop, :message, 1, "grpc.testing.ClosedLoopParams"
optional :poisson, :message, 2, "grpc.testing.PoissonParams"
optional :uniform, :message, 3, "grpc.testing.UniformParams"
optional :determ, :message, 4, "grpc.testing.DeterministicParams"
optional :pareto, :message, 5, "grpc.testing.ParetoParams"
end
end
add_message "grpc.testing.SecurityParams" do
optional :use_test_ca, :bool, 1
optional :server_host_override, :string, 2
end
add_message "grpc.testing.ClientConfig" do
repeated :server_targets, :string, 1
optional :client_type, :enum, 2, "grpc.testing.ClientType"
optional :security_params, :message, 3, "grpc.testing.SecurityParams"
optional :outstanding_rpcs_per_channel, :int32, 4
optional :client_channels, :int32, 5
optional :async_client_threads, :int32, 7
optional :rpc_type, :enum, 8, "grpc.testing.RpcType"
optional :load_params, :message, 10, "grpc.testing.LoadParams"
optional :payload_config, :message, 11, "grpc.testing.PayloadConfig"
optional :histogram_params, :message, 12, "grpc.testing.HistogramParams"
repeated :core_list, :int32, 13
optional :core_limit, :int32, 14
end
add_message "grpc.testing.ClientStatus" do
optional :stats, :message, 1, "grpc.testing.ClientStats"
end
add_message "grpc.testing.Mark" do
optional :reset, :bool, 1
end
add_message "grpc.testing.ClientArgs" do
oneof :argtype do
optional :setup, :message, 1, "grpc.testing.ClientConfig"
optional :mark, :message, 2, "grpc.testing.Mark"
end
end
add_message "grpc.testing.ServerConfig" do
optional :server_type, :enum, 1, "grpc.testing.ServerType"
optional :security_params, :message, 2, "grpc.testing.SecurityParams"
optional :port, :int32, 4
optional :async_server_threads, :int32, 7
optional :core_limit, :int32, 8
optional :payload_config, :message, 9, "grpc.testing.PayloadConfig"
repeated :core_list, :int32, 10
end
add_message "grpc.testing.ServerArgs" do
oneof :argtype do
optional :setup, :message, 1, "grpc.testing.ServerConfig"
optional :mark, :message, 2, "grpc.testing.Mark"
end
end
add_message "grpc.testing.ServerStatus" do
optional :stats, :message, 1, "grpc.testing.ServerStats"
optional :port, :int32, 2
optional :cores, :int32, 3
end
add_message "grpc.testing.CoreRequest" do
end
add_message "grpc.testing.CoreResponse" do
optional :cores, :int32, 1
end
add_message "grpc.testing.Void" do
end
add_enum "grpc.testing.ClientType" do
value :SYNC_CLIENT, 0
value :ASYNC_CLIENT, 1
end
add_enum "grpc.testing.ServerType" do
value :SYNC_SERVER, 0
value :ASYNC_SERVER, 1
value :ASYNC_GENERIC_SERVER, 2
end
add_enum "grpc.testing.RpcType" do
value :UNARY, 0
value :STREAMING, 1
end
end
module Grpc
module Testing
PoissonParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PoissonParams").msgclass
UniformParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.UniformParams").msgclass
DeterministicParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.DeterministicParams").msgclass
ParetoParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ParetoParams").msgclass
ClosedLoopParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClosedLoopParams").msgclass
LoadParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadParams").msgclass
SecurityParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SecurityParams").msgclass
ClientConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientConfig").msgclass
ClientStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientStatus").msgclass
Mark = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Mark").msgclass
ClientArgs = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientArgs").msgclass
ServerConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerConfig").msgclass
ServerArgs = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerArgs").msgclass
ServerStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerStatus").msgclass
CoreRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.CoreRequest").msgclass
CoreResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.CoreResponse").msgclass
Void = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Void").msgclass
ClientType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientType").enummodule
ServerType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerType").enummodule
RpcType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.RpcType").enummodule
end
end

@ -0,0 +1,80 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: src/proto/grpc/testing/messages.proto
require 'google/protobuf'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "grpc.testing.Payload" do
optional :type, :enum, 1, "grpc.testing.PayloadType"
optional :body, :bytes, 2
end
add_message "grpc.testing.EchoStatus" do
optional :code, :int32, 1
optional :message, :string, 2
end
add_message "grpc.testing.SimpleRequest" do
optional :response_type, :enum, 1, "grpc.testing.PayloadType"
optional :response_size, :int32, 2
optional :payload, :message, 3, "grpc.testing.Payload"
optional :fill_username, :bool, 4
optional :fill_oauth_scope, :bool, 5
optional :response_compression, :enum, 6, "grpc.testing.CompressionType"
optional :response_status, :message, 7, "grpc.testing.EchoStatus"
end
add_message "grpc.testing.SimpleResponse" do
optional :payload, :message, 1, "grpc.testing.Payload"
optional :username, :string, 2
optional :oauth_scope, :string, 3
end
add_message "grpc.testing.StreamingInputCallRequest" do
optional :payload, :message, 1, "grpc.testing.Payload"
end
add_message "grpc.testing.StreamingInputCallResponse" do
optional :aggregated_payload_size, :int32, 1
end
add_message "grpc.testing.ResponseParameters" do
optional :size, :int32, 1
optional :interval_us, :int32, 2
end
add_message "grpc.testing.StreamingOutputCallRequest" do
optional :response_type, :enum, 1, "grpc.testing.PayloadType"
repeated :response_parameters, :message, 2, "grpc.testing.ResponseParameters"
optional :payload, :message, 3, "grpc.testing.Payload"
optional :response_compression, :enum, 6, "grpc.testing.CompressionType"
optional :response_status, :message, 7, "grpc.testing.EchoStatus"
end
add_message "grpc.testing.StreamingOutputCallResponse" do
optional :payload, :message, 1, "grpc.testing.Payload"
end
add_message "grpc.testing.ReconnectInfo" do
optional :passed, :bool, 1
repeated :backoff_ms, :int32, 2
end
add_enum "grpc.testing.PayloadType" do
value :COMPRESSABLE, 0
value :UNCOMPRESSABLE, 1
value :RANDOM, 2
end
add_enum "grpc.testing.CompressionType" do
value :NONE, 0
value :GZIP, 1
value :DEFLATE, 2
end
end
module Grpc
module Testing
Payload = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Payload").msgclass
EchoStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.EchoStatus").msgclass
SimpleRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleRequest").msgclass
SimpleResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleResponse").msgclass
StreamingInputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallRequest").msgclass
StreamingInputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallResponse").msgclass
ResponseParameters = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ResponseParameters").msgclass
StreamingOutputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallRequest").msgclass
StreamingOutputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallResponse").msgclass
ReconnectInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass
PayloadType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule
CompressionType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.CompressionType").enummodule
end
end

@ -0,0 +1,33 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: src/proto/grpc/testing/payloads.proto
require 'google/protobuf'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "grpc.testing.ByteBufferParams" do
optional :req_size, :int32, 1
optional :resp_size, :int32, 2
end
add_message "grpc.testing.SimpleProtoParams" do
optional :req_size, :int32, 1
optional :resp_size, :int32, 2
end
add_message "grpc.testing.ComplexProtoParams" do
end
add_message "grpc.testing.PayloadConfig" do
oneof :payload do
optional :bytebuf_params, :message, 1, "grpc.testing.ByteBufferParams"
optional :simple_params, :message, 2, "grpc.testing.SimpleProtoParams"
optional :complex_params, :message, 3, "grpc.testing.ComplexProtoParams"
end
end
end
module Grpc
module Testing
ByteBufferParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ByteBufferParams").msgclass
SimpleProtoParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleProtoParams").msgclass
ComplexProtoParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ComplexProtoParams").msgclass
PayloadConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadConfig").msgclass
end
end

@ -0,0 +1,14 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: src/proto/grpc/testing/services.proto
require 'google/protobuf'
require 'src/proto/grpc/testing/messages'
require 'src/proto/grpc/testing/control'
Google::Protobuf::DescriptorPool.generated_pool.build do
end
module Grpc
module Testing
end
end

@ -0,0 +1,46 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Source: src/proto/grpc/testing/services.proto for package 'grpc.testing'
require 'grpc'
require 'src/proto/grpc/testing/services'
module Grpc
module Testing
module BenchmarkService
# TODO: add proto service documentation here
class Service
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
self.service_name = 'grpc.testing.BenchmarkService'
rpc :UnaryCall, SimpleRequest, SimpleResponse
rpc :StreamingCall, stream(SimpleRequest), stream(SimpleResponse)
end
Stub = Service.rpc_stub_class
end
module WorkerService
# TODO: add proto service documentation here
class Service
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
self.service_name = 'grpc.testing.WorkerService'
rpc :RunServer, stream(ServerArgs), stream(ServerStatus)
rpc :RunClient, stream(ClientArgs), stream(ClientStatus)
rpc :CoreCount, CoreRequest, CoreResponse
rpc :QuitWorker, Void, Void
end
Stub = Service.rpc_stub_class
end
end
end

@ -0,0 +1,39 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: src/proto/grpc/testing/stats.proto
require 'google/protobuf'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "grpc.testing.ServerStats" do
optional :time_elapsed, :double, 1
optional :time_user, :double, 2
optional :time_system, :double, 3
end
add_message "grpc.testing.HistogramParams" do
optional :resolution, :double, 1
optional :max_possible, :double, 2
end
add_message "grpc.testing.HistogramData" do
repeated :bucket, :uint32, 1
optional :min_seen, :double, 2
optional :max_seen, :double, 3
optional :sum, :double, 4
optional :sum_of_squares, :double, 5
optional :count, :double, 6
end
add_message "grpc.testing.ClientStats" do
optional :latencies, :message, 1, "grpc.testing.HistogramData"
optional :time_elapsed, :double, 2
optional :time_user, :double, 3
optional :time_system, :double, 4
end
end
module Grpc
module Testing
ServerStats = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerStats").msgclass
HistogramParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.HistogramParams").msgclass
HistogramData = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.HistogramData").msgclass
ClientStats = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientStats").msgclass
end
end

@ -0,0 +1,128 @@
#!/usr/bin/env ruby
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Worker and worker service implementation
this_dir = File.expand_path(File.dirname(__FILE__))
lib_dir = File.join(File.dirname(this_dir), 'lib')
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
$LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir)
require 'grpc'
require 'optparse'
require 'histogram'
require 'etc'
require 'facter'
require 'client'
require 'qps-common'
require 'server'
require 'src/proto/grpc/testing/services_services'
class WorkerServiceImpl < Grpc::Testing::WorkerService::Service
def cpu_cores
Facter.value('processors')['count']
end
def run_server(reqs)
q = EnumeratorQueue.new(self)
Thread.new {
bms = ''
gtss = Grpc::Testing::ServerStatus
reqs.each do |req|
case req.argtype.to_s
when 'setup'
bms = BenchmarkServer.new(req.setup, @server_port)
q.push(gtss.new(stats: bms.mark(false), port: bms.get_port))
when 'mark'
q.push(gtss.new(stats: bms.mark(req.mark.reset), cores: cpu_cores))
end
end
q.push(self)
bms.stop
}
q.each_item
end
def run_client(reqs)
q = EnumeratorQueue.new(self)
Thread.new {
client = ''
reqs.each do |req|
case req.argtype.to_s
when 'setup'
client = BenchmarkClient.new(req.setup)
q.push(Grpc::Testing::ClientStatus.new(stats: client.mark(false)))
when 'mark'
q.push(Grpc::Testing::ClientStatus.new(stats:
client.mark(req.mark.reset)))
end
end
q.push(self)
client.shutdown
}
q.each_item
end
def core_count(_args, _call)
Grpc::Testing::CoreResponse.new(cores: cpu_cores)
end
def quit_worker(_args, _call)
Thread.new {
sleep 3
@server.stop
}
Grpc::Testing::Void.new
end
def initialize(s, sp)
@server = s
@server_port = sp
end
end
def main
options = {
'driver_port' => 0,
'server_port' => 0
}
OptionParser.new do |opts|
opts.banner = 'Usage: [--driver_port <port>] [--server_port <port>]'
opts.on('--driver_port PORT', '<port>') do |v|
options['driver_port'] = v
end
opts.on('--server_port PORT', '<port>') do |v|
options['server_port'] = v
end
end.parse!
s = GRPC::RpcServer.new
s.add_http2_port("0.0.0.0:" + options['driver_port'].to_s,
:this_port_is_insecure)
s.handle(WorkerServiceImpl.new(s, options['server_port'].to_i))
s.run
end
main

@ -31,7 +31,7 @@
*
*/
#include "src/core/lib/census/mlog.h"
#include "src/core/ext/census/mlog.h"
#include <grpc/support/cpu.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>

@ -31,13 +31,12 @@
*
*/
#include "src/core/lib/client_config/resolvers/dns_resolver.h"
#include <string.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include "src/core/lib/client_config/resolver_registry.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/timer.h"
#include "test/core/util/test_config.h"
@ -79,7 +78,7 @@ static grpc_resolved_addresses *my_resolve_address(const char *name,
}
static grpc_resolver *create_resolver(const char *name) {
grpc_resolver_factory *factory = grpc_dns_resolver_factory_create();
grpc_resolver_factory *factory = grpc_resolver_factory_lookup("dns");
grpc_uri *uri = grpc_uri_parse(name, 0);
GPR_ASSERT(uri);
grpc_resolver_args args;

@ -31,13 +31,11 @@
*
*/
#include "src/core/lib/client_config/resolvers/dns_resolver.h"
#include <string.h>
#include <grpc/support/log.h>
#include "src/core/lib/client_config/resolver.h"
#include "src/core/lib/client_config/resolver_registry.h"
#include "test/core/util/test_config.h"
static void subchannel_factory_ref(grpc_subchannel_factory *scv) {}
@ -92,8 +90,9 @@ static void test_fails(grpc_resolver_factory *factory, const char *string) {
int main(int argc, char **argv) {
grpc_resolver_factory *dns;
grpc_test_init(argc, argv);
grpc_init();
dns = grpc_dns_resolver_factory_create();
dns = grpc_resolver_factory_lookup("dns");
test_succeeds(dns, "dns:10.2.1.1");
test_succeeds(dns, "dns:10.2.1.1:1234");
@ -101,6 +100,7 @@ int main(int argc, char **argv) {
test_fails(dns, "ipv4://8.8.8.8/8.8.8.8:8888");
grpc_resolver_factory_unref(dns);
grpc_shutdown();
return 0;
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save