Peer service optimization (#5056)

This commit is contained in:
Trask Stalnaker 2022-01-10 00:01:28 -08:00 committed by GitHub
parent c3e0c258d7
commit 642f2c1614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -58,6 +58,12 @@ public final class PeerServiceAttributesExtractor<REQUEST, RESPONSE>
REQUEST request,
@Nullable RESPONSE response,
@Nullable Throwable error) {
if (peerServiceMapping.isEmpty()) {
// optimization for common case
return;
}
String peerName = netClientAttributesExtractor.peerName(request, response);
String peerService = mapToPeerService(peerName);
if (peerService == null) {