Skip to content

Commit abb08a5

Browse files
committed
logs the metrics inside sync context
1 parent 621d486 commit abb08a5

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

core/src/main/java/io/grpc/internal/DelayedClientTransport.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ public ListenableFuture<SocketStats> getStats() {
201201
}
202202

203203
/**
204-
* Prevents creating any new streams. Buffered streams are not failed and may still proceed
205-
* when {@link #reprocess} is called. The delayed transport will be terminated when there is no
204+
* Prevents creating any new streams. Buffered streams are not failed and may still proceed
205+
* when {@link #reprocess} is called. The delayed transport will be terminated when there is no
206206
* more buffered streams.
207207
*/
208208
@Override

core/src/main/java/io/grpc/internal/InternalSubchannel.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -588,15 +588,6 @@ public Attributes filterTransport(Attributes attributes) {
588588
@Override
589589
public void transportReady() {
590590
channelLogger.log(ChannelLogLevel.INFO, "READY");
591-
subchannelMetrics.recordConnectionAttemptSucceeded(buildLabelSet(
592-
getAttributeOrDefault(
593-
addressIndex.getCurrentEagAttributes(), NameResolver.ATTR_BACKEND_SERVICE),
594-
getAttributeOrDefault(
595-
addressIndex.getCurrentEagAttributes(), LoadBalancer.ATTR_LOCALITY_NAME),
596-
null,
597-
extractSecurityLevel(
598-
addressIndex.getCurrentEagAttributes().get(GrpcAttributes.ATTR_SECURITY_LEVEL))
599-
));
600591
syncContext.execute(new Runnable() {
601592
@Override
602593
public void run() {
@@ -633,22 +624,6 @@ public void transportShutdown(final Status s) {
633624
channelLogger.log(
634625
ChannelLogLevel.INFO, "{0} SHUTDOWN with {1}", transport.getLogId(), printShortStatus(s));
635626
shutdownInitiated = true;
636-
subchannelMetrics.recordConnectionAttemptFailed(buildLabelSet(
637-
getAttributeOrDefault(
638-
addressIndex.getCurrentEagAttributes(), NameResolver.ATTR_BACKEND_SERVICE),
639-
getAttributeOrDefault(
640-
addressIndex.getCurrentEagAttributes(), LoadBalancer.ATTR_LOCALITY_NAME),
641-
null, null
642-
));
643-
subchannelMetrics.recordDisconnection(buildLabelSet(
644-
getAttributeOrDefault(
645-
addressIndex.getCurrentEagAttributes(), NameResolver.ATTR_BACKEND_SERVICE),
646-
getAttributeOrDefault(
647-
addressIndex.getCurrentEagAttributes(), LoadBalancer.ATTR_LOCALITY_NAME),
648-
"Peer Pressure",
649-
extractSecurityLevel(
650-
addressIndex.getCurrentEagAttributes().get(GrpcAttributes.ATTR_SECURITY_LEVEL))
651-
));
652627
syncContext.execute(new Runnable() {
653628
@Override
654629
public void run() {

0 commit comments

Comments
 (0)