mirror of https://github.com/grpc/grpc-java.git
core: fix build in CensusStatsModule.
This commit is contained in:
parent
8edead0851
commit
61d5baa5f2
|
|
@ -239,7 +239,7 @@ final class CensusStatsModule {
|
||||||
if (callEndedUpdater.getAndSet(this, 1) != 0) {
|
if (callEndedUpdater.getAndSet(this, 1) != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!recordStats) {
|
if (!module.recordStats) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
stopwatch.stop();
|
stopwatch.stop();
|
||||||
|
|
@ -288,6 +288,7 @@ final class CensusStatsModule {
|
||||||
private static final AtomicLongFieldUpdater<ServerTracer> inboundUncompressedSizeUpdater =
|
private static final AtomicLongFieldUpdater<ServerTracer> inboundUncompressedSizeUpdater =
|
||||||
AtomicLongFieldUpdater.newUpdater(ServerTracer.class, "inboundUncompressedSize");
|
AtomicLongFieldUpdater.newUpdater(ServerTracer.class, "inboundUncompressedSize");
|
||||||
|
|
||||||
|
private final CensusStatsModule module;
|
||||||
private final String fullMethodName;
|
private final String fullMethodName;
|
||||||
@Nullable
|
@Nullable
|
||||||
private final StatsContext parentCtx;
|
private final StatsContext parentCtx;
|
||||||
|
|
@ -302,10 +303,12 @@ final class CensusStatsModule {
|
||||||
private volatile long inboundUncompressedSize;
|
private volatile long inboundUncompressedSize;
|
||||||
|
|
||||||
ServerTracer(
|
ServerTracer(
|
||||||
|
CensusStatsModule module,
|
||||||
String fullMethodName,
|
String fullMethodName,
|
||||||
StatsContext parentCtx,
|
StatsContext parentCtx,
|
||||||
Supplier<Stopwatch> stopwatchSupplier,
|
Supplier<Stopwatch> stopwatchSupplier,
|
||||||
StatsContextFactory statsCtxFactory) {
|
StatsContextFactory statsCtxFactory) {
|
||||||
|
this.module = module;
|
||||||
this.fullMethodName = checkNotNull(fullMethodName, "fullMethodName");
|
this.fullMethodName = checkNotNull(fullMethodName, "fullMethodName");
|
||||||
this.parentCtx = checkNotNull(parentCtx, "parentCtx");
|
this.parentCtx = checkNotNull(parentCtx, "parentCtx");
|
||||||
this.stopwatch = stopwatchSupplier.get().start();
|
this.stopwatch = stopwatchSupplier.get().start();
|
||||||
|
|
@ -353,7 +356,7 @@ final class CensusStatsModule {
|
||||||
if (streamClosedUpdater.getAndSet(this, 1) != 0) {
|
if (streamClosedUpdater.getAndSet(this, 1) != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!recordStats) {
|
if (!module.recordStats) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
stopwatch.stop();
|
stopwatch.stop();
|
||||||
|
|
@ -394,7 +397,8 @@ final class CensusStatsModule {
|
||||||
parentCtx = statsCtxFactory.getDefault();
|
parentCtx = statsCtxFactory.getDefault();
|
||||||
}
|
}
|
||||||
parentCtx = parentCtx.with(RpcConstants.RPC_SERVER_METHOD, TagValue.create(fullMethodName));
|
parentCtx = parentCtx.with(RpcConstants.RPC_SERVER_METHOD, TagValue.create(fullMethodName));
|
||||||
return new ServerTracer(fullMethodName, parentCtx, stopwatchSupplier, statsCtxFactory);
|
return new ServerTracer(
|
||||||
|
CensusStatsModule.this, fullMethodName, parentCtx, stopwatchSupplier, statsCtxFactory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue