grpc.go ×6

Frontier kind: Code frontier

unlabeled · c_00180773636d

13 tests · 453 LOC · 23 files · introduces 0 tests · 40 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges40 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
66 ranges453 lines · 23 files · Browse complete extent
All tests (intent)
13 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

3 files ranked by introduced lines: 40 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/metrics/grpc.go 20 introduced LOC · 6 ranges

Open complete file

86 handler grpc.UnaryHandler,
87 ) (any, error) {
88 > // we want to return original handler response, so don't override err grpc.go
89 > resp, err := handler(ctx, req)
90 >
91 > select {
92 case <-ctx.Done():
93 return resp, err
94 > default: grpc.go
95 }
96
97 > metricsCtx := getMetricsContext(ctx) grpc.go
98 > if metricsCtx == nil {
99 return resp, err
100 }
101
102 > metricsBaggage := &metricsspb.Baggage{CountersInt: make(map[string]int64)} grpc.go
103 >
104 > metricsCtx.Lock()
105 > maps.Copy(metricsBaggage.CountersInt, metricsCtx.CountersInt)
106 > metricsCtx.Unlock()
107 >
108 > bytes, marshalErr := metricsBaggage.Marshal()
109 > if marshalErr != nil {
110 logger.Error("unable to marshal metric baggage", tag.Error(marshalErr))
111 }
112
113 > md := metadata.Pairs(metricsTrailerKey, string(bytes)) grpc.go
114 >
115 > marshalErr = grpc.SetTrailer(ctx, md)
116 > if marshalErr != nil {
117 logger.Error("unable to add metrics baggage to gRPC trailer", tag.Error(marshalErr))
118 }
119
120 > return resp, err grpc.go
121 }
122 }
go.temporal.io/server/api/metrics/v1/message.pb.go 14 introduced LOC · 2 ranges

Open complete file

30 }
31
32 > func (x *Baggage) Reset() { message.pb.go
33 > *x = Baggage{}
34 > mi := &file_temporal_server_api_metrics_v1_message_proto_msgTypes[0]
35 > ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
36 > ms.StoreMessageInfo(mi)
37 > }
38
39 func (x *Baggage) String() string {
43 func (*Baggage) ProtoMessage() {}
44
45 > func (x *Baggage) ProtoReflect() protoreflect.Message { message.pb.go
46 > mi := &file_temporal_server_api_metrics_v1_message_proto_msgTypes[0]
47 > if x != nil {
48 > ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
49 > if ms.LoadMessageInfo() == nil {
50 > ms.StoreMessageInfo(mi)
51 > }
52 > return ms
53 }
54 return mi.MessageOf(x)
go.temporal.io/server/api/metrics/v1/message.go-helpers.pb.go 6 introduced LOC · 2 ranges

Open complete file

7
8 // Marshal an object of type Baggage to the protobuf v3 wire format
9 > func (val *Baggage) Marshal() ([]byte, error) { message.go-helpers.pb.go
10 > return proto.Marshal(val)
11 > }
12
13 // Unmarshal an object of type Baggage from the protobuf v3 wire format
14 > func (val *Baggage) Unmarshal(buf []byte) error { message.go-helpers.pb.go
15 > return proto.Unmarshal(buf, val)
16 > }
17
18 // Size returns the size of the object, in bytes, once serialized