client_channel_channelz.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_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_CHANNELZ_H
20 #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_CHANNELZ_H
21 
23 
24 #include <stddef.h>
25 
26 #include <atomic>
27 #include <string>
28 #include <utility>
29 
30 #include "absl/base/thread_annotations.h"
31 
33 #include <grpc/slice.h>
34 
39 #include "src/core/lib/json/json.h"
40 
41 namespace grpc_core {
42 namespace channelz {
43 
44 class SubchannelNode : public BaseNode {
45  public:
46  SubchannelNode(std::string target_address, size_t channel_tracer_max_nodes);
47  ~SubchannelNode() override;
48 
49  // Sets the subchannel's connectivity state without health checking.
51 
52  // Used when the subchannel's child socket changes. This should be set when
53  // the subchannel's transport is created and set to nullptr when the
54  // subchannel unrefs the transport.
56 
57  Json RenderJson() override;
58 
59  // proxy methods to composed classes.
62  }
64  const grpc_slice& data,
65  RefCountedPtr<BaseNode> referenced_channel) {
67  std::move(referenced_channel));
68  }
72 
73  private:
74  std::atomic<grpc_connectivity_state> connectivity_state_{GRPC_CHANNEL_IDLE};
80 };
81 
82 } // namespace channelz
83 } // namespace grpc_core
84 
85 #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_CHANNELZ_H */
grpc_core::channelz::SubchannelNode::call_counter_
CallCountingHelper call_counter_
Definition: client_channel_channelz.h:78
bloat_diff.severity
def severity
Definition: bloat_diff.py:143
grpc_core::channelz::ChannelTrace::AddTraceEventWithReference
void AddTraceEventWithReference(Severity severity, const grpc_slice &data, RefCountedPtr< BaseNode > referenced_entity)
Definition: channel_trace.cc:113
grpc_core::channelz::SubchannelNode::RecordCallStarted
void RecordCallStarted()
Definition: client_channel_channelz.h:69
slice.h
grpc_core::channelz::SubchannelNode::SubchannelNode
SubchannelNode(std::string target_address, size_t channel_tracer_max_nodes)
Definition: client_channel_channelz.cc:32
grpc_core
Definition: call_metric_recorder.h:31
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc_core::channelz::SubchannelNode::AddTraceEventWithReference
void AddTraceEventWithReference(ChannelTrace::Severity severity, const grpc_slice &data, RefCountedPtr< BaseNode > referenced_channel)
Definition: client_channel_channelz.h:63
grpc_core::channelz::SubchannelNode::trace_
ChannelTrace trace_
Definition: client_channel_channelz.h:79
grpc_core::channelz::SubchannelNode::AddTraceEvent
void AddTraceEvent(ChannelTrace::Severity severity, const grpc_slice &data)
Definition: client_channel_channelz.h:60
grpc_core::channelz::SubchannelNode::RenderJson
Json RenderJson() override
Definition: client_channel_channelz.cc:49
grpc_core::channelz::SubchannelNode::socket_mu_
Mutex socket_mu_
Definition: client_channel_channelz.h:75
grpc_core::channelz::SubchannelNode::SetChildSocket
void SetChildSocket(RefCountedPtr< SocketNode > socket)
Definition: client_channel_channelz.cc:44
channelz.h
grpc_core::channelz::CallCountingHelper::RecordCallFailed
void RecordCallFailed()
Definition: src/core/lib/channel/channelz.cc:92
grpc_connectivity_state
grpc_connectivity_state
Definition: include/grpc/impl/codegen/connectivity_state.h:30
grpc_core::RefCountedPtr
Definition: ref_counted_ptr.h:35
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
Json
JSON (JavaScript Object Notation).
Definition: third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h:227
grpc_core::channelz::CallCountingHelper::RecordCallStarted
void RecordCallStarted()
Definition: src/core/lib/channel/channelz.cc:84
connectivity_state.h
grpc_core::channelz::BaseNode
Definition: channelz.h:78
GRPC_CHANNEL_IDLE
@ GRPC_CHANNEL_IDLE
Definition: include/grpc/impl/codegen/connectivity_state.h:32
grpc_core::channelz::SubchannelNode::ABSL_GUARDED_BY
RefCountedPtr< SocketNode > child_socket_ ABSL_GUARDED_BY(socket_mu_)
grpc_slice
Definition: include/grpc/impl/codegen/slice.h:65
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
grpc_core::channelz::ChannelTrace::Severity
Severity
Definition: channel_trace.h:51
json.h
grpc_core::channelz::CallCountingHelper
Definition: channelz.h:122
grpc_core::Mutex
Definition: src/core/lib/gprpp/sync.h:61
grpc_core::channelz::SubchannelNode::target_
std::string target_
Definition: client_channel_channelz.h:77
grpc_core::channelz::SubchannelNode
Definition: client_channel_channelz.h:44
state
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:41
channelz
void channelz(grpc_end2end_test_config config)
Definition: test/core/end2end/tests/channelz.cc:318
ref_counted_ptr.h
grpc_core::channelz::SubchannelNode::~SubchannelNode
~SubchannelNode() override
Definition: client_channel_channelz.cc:38
grpc_core::channelz::CallCountingHelper::RecordCallSucceeded
void RecordCallSucceeded()
Definition: src/core/lib/channel/channelz.cc:97
grpc_core::channelz::SubchannelNode::RecordCallFailed
void RecordCallFailed()
Definition: client_channel_channelz.h:70
grpc_core::channelz::SubchannelNode::RecordCallSucceeded
void RecordCallSucceeded()
Definition: client_channel_channelz.h:71
test_server.socket
socket
Definition: test_server.py:65
grpc_core::channelz::SubchannelNode::UpdateConnectivityState
void UpdateConnectivityState(grpc_connectivity_state state)
Definition: client_channel_channelz.cc:40
channel_trace.h
grpc_core::channelz::SubchannelNode::connectivity_state_
std::atomic< grpc_connectivity_state > connectivity_state_
Definition: client_channel_channelz.h:74
sync.h
grpc_core::channelz::ChannelTrace
Definition: channel_trace.h:46
port_platform.h
grpc_core::channelz::ChannelTrace::AddTraceEvent
void AddTraceEvent(Severity severity, const grpc_slice &data)
Definition: channel_trace.cc:105


grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:55