aboutsummaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorKun Zhang <zhangkun83@users.noreply.github.com>2017-11-01 16:46:05 -0700
committerGitHub <noreply@github.com>2017-11-01 16:46:05 -0700
commitd87ef74082220bdbdcb98b94cd9a3dac9482d813 (patch)
treec1e5998a130e3ceda67ff4a2aff4f70c474e8b43 /compiler
parent253a01461b4999b6aeb27e54d88ef0bba04239b1 (diff)
downloadgrpc-grpc-java-d87ef74082220bdbdcb98b94cd9a3dac9482d813.tar.gz
core: set sampled for local span per MethodDescriptor. (#3627)
This moves away from the global String-based Span name registry which is not as flexible as we desire. Also renamed the option name to be more accurate. This is not API-breaking because the origianl addition to MethodDescriptor and code-gen didn't make it into the 1.7.0 release.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/src/java_plugin/cpp/java_generator.cpp4
-rw-r--r--compiler/src/test/golden/TestService.java.txt10
-rw-r--r--compiler/src/testLite/golden/TestService.java.txt10
-rw-r--r--compiler/src/testNano/golden/TestService.java.txt10
4 files changed, 17 insertions, 17 deletions
diff --git a/compiler/src/java_plugin/cpp/java_generator.cpp b/compiler/src/java_plugin/cpp/java_generator.cpp
index 91aa78c80..ad818b532 100644
--- a/compiler/src/java_plugin/cpp/java_generator.cpp
+++ b/compiler/src/java_plugin/cpp/java_generator.cpp
@@ -363,7 +363,7 @@ static void PrintMethodFields(
" .setType($MethodType$.$method_type$)\n"
" .setFullMethodName(generateFullMethodName(\n"
" \"$Package$$service_name$\", \"$method_name$\"))\n"
- " .setRegisterForTracing(true)\n"
+ " .setSampledToLocalTracing(true)\n"
" .setRequestMarshaller($NanoUtils$.<$input_type$>marshaller(\n"
" new NanoFactory<$input_type$>(ARG_IN_$method_field_name$)))\n"
" .setResponseMarshaller($NanoUtils$.<$output_type$>marshaller(\n"
@@ -402,7 +402,7 @@ static void PrintMethodFields(
" .setType($MethodType$.$method_type$)\n"
" .setFullMethodName(generateFullMethodName(\n"
" \"$Package$$service_name$\", \"$method_name$\"))\n"
- " .setRegisterForTracing(true)\n"
+ " .setSampledToLocalTracing(true)\n"
" .setRequestMarshaller($ProtoUtils$.marshaller(\n"
" $input_type$.getDefaultInstance()))\n"
" .setResponseMarshaller($ProtoUtils$.marshaller(\n"
diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt
index 54f3955c7..055504885 100644
--- a/compiler/src/test/golden/TestService.java.txt
+++ b/compiler/src/test/golden/TestService.java.txt
@@ -50,7 +50,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "UnaryCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.grpc.testing.integration.Test.SimpleRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
@@ -82,7 +82,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "StreamingOutputCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
@@ -114,7 +114,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "StreamingInputCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.grpc.testing.integration.Test.StreamingInputCallRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
@@ -146,7 +146,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "FullBidiCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
@@ -178,7 +178,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "HalfBidiCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
diff --git a/compiler/src/testLite/golden/TestService.java.txt b/compiler/src/testLite/golden/TestService.java.txt
index 412752f54..af8d0b66e 100644
--- a/compiler/src/testLite/golden/TestService.java.txt
+++ b/compiler/src/testLite/golden/TestService.java.txt
@@ -50,7 +50,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "UnaryCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
io.grpc.testing.integration.Test.SimpleRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
@@ -81,7 +81,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "StreamingOutputCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
@@ -112,7 +112,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "StreamingInputCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
io.grpc.testing.integration.Test.StreamingInputCallRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
@@ -143,7 +143,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "FullBidiCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
@@ -174,7 +174,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "HalfBidiCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
io.grpc.testing.integration.Test.StreamingOutputCallRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(
diff --git a/compiler/src/testNano/golden/TestService.java.txt b/compiler/src/testNano/golden/TestService.java.txt
index 8821167ed..19ac8244e 100644
--- a/compiler/src/testNano/golden/TestService.java.txt
+++ b/compiler/src/testNano/golden/TestService.java.txt
@@ -54,7 +54,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "UnaryCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.SimpleRequest>marshaller(
new NanoFactory<io.grpc.testing.integration.nano.Test.SimpleRequest>(ARG_IN_METHOD_UNARY_CALL)))
.setResponseMarshaller(io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.SimpleResponse>marshaller(
@@ -87,7 +87,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "StreamingOutputCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>marshaller(
new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>(ARG_IN_METHOD_STREAMING_OUTPUT_CALL)))
.setResponseMarshaller(io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>marshaller(
@@ -120,7 +120,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "StreamingInputCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest>marshaller(
new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest>(ARG_IN_METHOD_STREAMING_INPUT_CALL)))
.setResponseMarshaller(io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>marshaller(
@@ -153,7 +153,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "FullBidiCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>marshaller(
new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>(ARG_IN_METHOD_FULL_BIDI_CALL)))
.setResponseMarshaller(io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>marshaller(
@@ -186,7 +186,7 @@ public final class TestServiceGrpc {
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(generateFullMethodName(
"grpc.testing.TestService", "HalfBidiCall"))
- .setRegisterForTracing(true)
+ .setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>marshaller(
new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>(ARG_IN_METHOD_HALF_BIDI_CALL)))
.setResponseMarshaller(io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>marshaller(