src/cpp/server/load_reporter/constants.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2018 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_SRC_CPP_SERVER_LOAD_REPORTER_UTIL_H
20 #define GRPC_SRC_CPP_SERVER_LOAD_REPORTER_UTIL_H
21 
23 
24 #include <stddef.h>
25 #include <stdint.h>
26 
27 namespace grpc {
28 namespace load_reporter {
29 
30 // TODO(juanlishen): Update the version number with the PR number every time
31 // there is any change to the server load reporter.
32 constexpr uint32_t kVersion = 15853;
33 
34 // TODO(juanlishen): This window size is from the internal spec for the load
35 // reporter. Need to ask the gRPC LB team whether we should make this and the
36 // fetching interval configurable.
39 
40 constexpr size_t kLbIdLength = 8;
41 constexpr size_t kIpv4AddressLength = 8;
42 constexpr size_t kIpv6AddressLength = 32;
43 
44 constexpr char kInvalidLbId[] = "<INVALID_LBID_238dsb234890rb>";
45 
46 // Call statuses.
47 
48 constexpr char kCallStatusOk[] = "OK";
49 constexpr char kCallStatusServerError[] = "5XX";
50 constexpr char kCallStatusClientError[] = "4XX";
51 
52 // Tag keys.
53 
54 constexpr char kTagKeyToken[] = "token";
55 constexpr char kTagKeyHost[] = "host";
56 constexpr char kTagKeyUserId[] = "user_id";
57 constexpr char kTagKeyStatus[] = "status";
58 constexpr char kTagKeyMetricName[] = "metric_name";
59 
60 // Measure names.
61 
62 constexpr char kMeasureStartCount[] = "grpc.io/lb/start_count";
63 constexpr char kMeasureEndCount[] = "grpc.io/lb/end_count";
64 constexpr char kMeasureEndBytesSent[] = "grpc.io/lb/bytes_sent";
65 constexpr char kMeasureEndBytesReceived[] = "grpc.io/lb/bytes_received";
66 constexpr char kMeasureEndLatencyMs[] = "grpc.io/lb/latency_ms";
67 constexpr char kMeasureOtherCallMetric[] = "grpc.io/lb/other_call_metric";
68 
69 // View names.
70 
71 constexpr char kViewStartCount[] = "grpc.io/lb_view/start_count";
72 constexpr char kViewEndCount[] = "grpc.io/lb_view/end_count";
73 constexpr char kViewEndBytesSent[] = "grpc.io/lb_view/bytes_sent";
74 constexpr char kViewEndBytesReceived[] = "grpc.io/lb_view/bytes_received";
75 constexpr char kViewEndLatencyMs[] = "grpc.io/lb_view/latency_ms";
76 constexpr char kViewOtherCallMetricCount[] =
77  "grpc.io/lb_view/other_call_metric_count";
78 constexpr char kViewOtherCallMetricValue[] =
79  "grpc.io/lb_view/other_call_metric_value";
80 
81 } // namespace load_reporter
82 } // namespace grpc
83 
84 #endif // GRPC_SRC_CPP_SERVER_LOAD_REPORTER_UTIL_H
grpc::load_reporter::kTagKeyStatus
constexpr char kTagKeyStatus[]
Definition: src/cpp/server/load_reporter/constants.h:57
grpc::load_reporter::kCallStatusServerError
constexpr char kCallStatusServerError[]
Definition: src/cpp/server/load_reporter/constants.h:49
grpc::load_reporter::kViewEndCount
constexpr char kViewEndCount[]
Definition: src/cpp/server/load_reporter/constants.h:72
grpc::load_reporter::kMeasureEndLatencyMs
constexpr char kMeasureEndLatencyMs[]
Definition: src/cpp/server/load_reporter/constants.h:66
grpc::load_reporter::kMeasureStartCount
constexpr char kMeasureStartCount[]
Definition: src/cpp/server/load_reporter/constants.h:62
grpc
Definition: grpcpp/alarm.h:33
grpc::load_reporter::kMeasureEndBytesSent
constexpr char kMeasureEndBytesSent[]
Definition: src/cpp/server/load_reporter/constants.h:64
grpc::load_reporter::kMeasureEndBytesReceived
constexpr char kMeasureEndBytesReceived[]
Definition: src/cpp/server/load_reporter/constants.h:65
grpc::load_reporter::kIpv6AddressLength
constexpr size_t kIpv6AddressLength
Definition: src/cpp/server/load_reporter/constants.h:42
grpc::load_reporter::kFeedbackSampleWindowSeconds
constexpr uint32_t kFeedbackSampleWindowSeconds
Definition: src/cpp/server/load_reporter/constants.h:37
grpc::load_reporter::kIpv4AddressLength
constexpr size_t kIpv4AddressLength
Definition: src/cpp/server/load_reporter/constants.h:41
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
grpc::load_reporter::kViewOtherCallMetricValue
constexpr char kViewOtherCallMetricValue[]
Definition: src/cpp/server/load_reporter/constants.h:78
grpc::load_reporter::kMeasureEndCount
constexpr char kMeasureEndCount[]
Definition: src/cpp/server/load_reporter/constants.h:63
grpc::load_reporter::kViewEndBytesReceived
constexpr char kViewEndBytesReceived[]
Definition: src/cpp/server/load_reporter/constants.h:74
grpc::load_reporter::kFetchAndSampleIntervalSeconds
constexpr uint32_t kFetchAndSampleIntervalSeconds
Definition: src/cpp/server/load_reporter/constants.h:38
grpc::load_reporter::kViewStartCount
constexpr char kViewStartCount[]
Definition: src/cpp/server/load_reporter/constants.h:71
grpc::load_reporter::kMeasureOtherCallMetric
constexpr char kMeasureOtherCallMetric[]
Definition: src/cpp/server/load_reporter/constants.h:67
grpc::load_reporter::kTagKeyUserId
constexpr char kTagKeyUserId[]
Definition: src/cpp/server/load_reporter/constants.h:56
grpc::load_reporter::kVersion
constexpr uint32_t kVersion
Definition: src/cpp/server/load_reporter/constants.h:32
stdint.h
grpc::load_reporter::kViewOtherCallMetricCount
constexpr char kViewOtherCallMetricCount[]
Definition: src/cpp/server/load_reporter/constants.h:76
grpc::load_reporter::kCallStatusOk
constexpr char kCallStatusOk[]
Definition: src/cpp/server/load_reporter/constants.h:48
grpc::load_reporter::kTagKeyMetricName
constexpr char kTagKeyMetricName[]
Definition: src/cpp/server/load_reporter/constants.h:58
grpc::load_reporter::kCallStatusClientError
constexpr char kCallStatusClientError[]
Definition: src/cpp/server/load_reporter/constants.h:50
port_platform.h
grpc::load_reporter::kViewEndLatencyMs
constexpr char kViewEndLatencyMs[]
Definition: src/cpp/server/load_reporter/constants.h:75
grpc::load_reporter::kLbIdLength
constexpr size_t kLbIdLength
Definition: src/cpp/server/load_reporter/constants.h:40
grpc::load_reporter::kTagKeyHost
constexpr char kTagKeyHost[]
Definition: src/cpp/server/load_reporter/constants.h:55
grpc::load_reporter::kViewEndBytesSent
constexpr char kViewEndBytesSent[]
Definition: src/cpp/server/load_reporter/constants.h:73
grpc::load_reporter::kInvalidLbId
constexpr char kInvalidLbId[]
Definition: src/cpp/server/load_reporter/constants.h:44
grpc::load_reporter::kTagKeyToken
constexpr char kTagKeyToken[]
Definition: src/cpp/server/load_reporter/constants.h:54


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:01