• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

grpc / grpc-java / #19180

29 Apr 2024 11:30PM UTC coverage: 88.296% (-0.06%) from 88.351%
#19180

push

github

web-flow
Plumb optional labels from LB to ClientStreamTracer

As part of gRFC A78:

> To support the locality label in the per-call metrics, we will provide
> a mechanism for LB picker to add optional labels to the call attempt
> tracer.

31435 of 35602 relevant lines covered (88.3%)

0.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

43.75
/../util/src/main/java/io/grpc/util/ForwardingClientStreamTracer.java
1
/*
2
 * Copyright 2019 The gRPC Authors
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package io.grpc.util;
18

19
import com.google.common.base.MoreObjects;
20
import io.grpc.Attributes;
21
import io.grpc.ClientStreamTracer;
22
import io.grpc.ExperimentalApi;
23
import io.grpc.Metadata;
24
import io.grpc.Status;
25

26
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/2861")
27
public abstract class ForwardingClientStreamTracer extends ClientStreamTracer {
1✔
28
  /** Returns the underlying {@code ClientStreamTracer}. */
29
  protected abstract ClientStreamTracer delegate();
30

31
  @Override
32
  public void streamCreated(Attributes transportAttrs, Metadata headers) {
33
    delegate().streamCreated(transportAttrs, headers);
1✔
34
  }
1✔
35

36
  @Override
37
  public void createPendingStream() {
38
    delegate().createPendingStream();
1✔
39
  }
1✔
40

41
  @Override
42
  public void outboundHeaders() {
43
    delegate().outboundHeaders();
1✔
44
  }
1✔
45

46
  @Override
47
  public void inboundHeaders() {
48
    delegate().inboundHeaders();
1✔
49
  }
1✔
50

51
  @Override
52
  public void inboundTrailers(Metadata trailers) {
53
    delegate().inboundTrailers(trailers);
1✔
54
  }
1✔
55

56
  @Override
57
  public void addOptionalLabel(String key, String value) {
58
    delegate().addOptionalLabel(key, value);
1✔
59
  }
1✔
60

61
  @Override
62
  public void streamClosed(Status status) {
63
    delegate().streamClosed(status);
×
64
  }
×
65

66
  @Override
67
  public void outboundMessage(int seqNo) {
68
    delegate().outboundMessage(seqNo);
×
69
  }
×
70

71
  @Override
72
  public void inboundMessage(int seqNo) {
73
    delegate().inboundMessage(seqNo);
×
74
  }
×
75

76
  @Override
77
  public void outboundMessageSent(int seqNo, long optionalWireSize, long optionalUncompressedSize) {
78
    delegate().outboundMessageSent(seqNo, optionalWireSize, optionalUncompressedSize);
×
79
  }
×
80

81
  @Override
82
  public void inboundMessageRead(int seqNo, long optionalWireSize, long optionalUncompressedSize) {
83
    delegate().inboundMessageRead(seqNo, optionalWireSize, optionalUncompressedSize);
×
84
  }
×
85

86
  @Override
87
  public void outboundWireSize(long bytes) {
88
    delegate().outboundWireSize(bytes);
×
89
  }
×
90

91
  @Override
92
  public void outboundUncompressedSize(long bytes) {
93
    delegate().outboundUncompressedSize(bytes);
×
94
  }
×
95

96
  @Override
97
  public void inboundWireSize(long bytes) {
98
    delegate().inboundWireSize(bytes);
×
99
  }
×
100

101
  @Override
102
  public void inboundUncompressedSize(long bytes) {
103
    delegate().inboundUncompressedSize(bytes);
×
104
  }
×
105

106
  @Override
107
  public String toString() {
108
    return MoreObjects.toStringHelper(this).add("delegate", delegate()).toString();
1✔
109
  }
110
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc