From c72431882aebbabc8971c4c59e9bc238b4cb4621 Mon Sep 17 00:00:00 2001 From: Kristen Kozak Date: Wed, 1 Nov 2017 15:53:31 -0700 Subject: [PATCH] Remove TODOs about checking stats collection state. gRPC shouldn't use the state to determine whether to initialize the CensusStatsModule, because the state can be changed at runtime. --- .../io/grpc/internal/AbstractManagedChannelImplBuilder.java | 4 ---- .../main/java/io/grpc/internal/AbstractServerImplBuilder.java | 4 ---- 2 files changed, 8 deletions(-) diff --git a/core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java b/core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java index 75dad9290ff1..0652cf402682 100644 --- a/core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java +++ b/core/src/main/java/io/grpc/internal/AbstractManagedChannelImplBuilder.java @@ -365,9 +365,6 @@ final List getEffectiveInterceptors() { : Tags.getTagPropagationComponent().getBinarySerializer(); StatsRecorder statsRecorder = this.statsRecorder != null ? this.statsRecorder : Stats.getStatsRecorder(); - // // TODO: How do we check whether stats is enabled, now that the StatsRecorder is always - // // non-null? Uncommenting this line causes test failures. - // if (Stats.getState() == StatsCollectionState.ENABLED) { CensusStatsModule censusStats = new CensusStatsModule( tagger, @@ -379,7 +376,6 @@ final List getEffectiveInterceptors() { // First interceptor runs last (see ClientInterceptors.intercept()), so that no // other interceptor can override the tracer factory we set in CallOptions. effectiveInterceptors.add(0, censusStats.getClientInterceptor()); - // } } if (tracingEnabled) { CensusTracingModule censusTracing = diff --git a/core/src/main/java/io/grpc/internal/AbstractServerImplBuilder.java b/core/src/main/java/io/grpc/internal/AbstractServerImplBuilder.java index 53576e36f4e6..2d6b00c1cc45 100644 --- a/core/src/main/java/io/grpc/internal/AbstractServerImplBuilder.java +++ b/core/src/main/java/io/grpc/internal/AbstractServerImplBuilder.java @@ -249,9 +249,6 @@ final List getTracerFactories() { : Tags.getTagPropagationComponent().getBinarySerializer(); StatsRecorder statsRecorder = this.statsRecorder != null ? this.statsRecorder : Stats.getStatsRecorder(); - // // TODO: How do we check whether stats is enabled, now that the StatsRecorder is always - // // non-null? Uncommenting this line causes test failures. - // if (Stats.getState() == StatsCollectionState.ENABLED) { CensusStatsModule censusStats = new CensusStatsModule( tagger, @@ -261,7 +258,6 @@ final List getTracerFactories() { true, recordStats); tracerFactories.add(censusStats.getServerTracerFactory()); - // } } if (tracingEnabled) { CensusTracingModule censusTracing =