src/core/lib/channel/channelz.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2017 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 
20 
22 
23 #include <stdlib.h>
24 
25 #include <algorithm>
26 #include <atomic>
27 #include <memory>
28 #include <type_traits>
29 
30 #include "absl/status/statusor.h"
31 #include "absl/strings/escaping.h"
32 #include "absl/strings/strip.h"
33 
35 #include <grpc/support/cpu.h>
36 #include <grpc/support/log.h>
37 #include <grpc/support/time.h>
38 
51 
52 namespace grpc_core {
53 namespace channelz {
54 
55 //
56 // BaseNode
57 //
58 
60  : type_(type), uuid_(-1), name_(std::move(name)) {
61  // The registry will set uuid_ under its lock.
63 }
64 
66 
68  Json json = RenderJson();
69  return json.Dump();
70 }
71 
72 //
73 // CallCountingHelper
74 //
75 
79  for (size_t i = 0; i < num_cores_; ++i) {
80  per_cpu_counter_data_storage_.emplace_back();
81  }
82 }
83 
87  data.calls_started.fetch_add(1, std::memory_order_relaxed);
88  data.last_call_started_cycle.store(gpr_get_cycle_counter(),
89  std::memory_order_relaxed);
90 }
91 
94  .calls_failed.fetch_add(1, std::memory_order_relaxed);
95 }
96 
99  .calls_succeeded.fetch_add(1, std::memory_order_relaxed);
100 }
101 
103  for (size_t core = 0; core < num_cores_; ++core) {
105 
106  out->calls_started += data.calls_started.load(std::memory_order_relaxed);
107  out->calls_succeeded +=
108  per_cpu_counter_data_storage_[core].calls_succeeded.load(
109  std::memory_order_relaxed);
110  out->calls_failed += per_cpu_counter_data_storage_[core].calls_failed.load(
111  std::memory_order_relaxed);
112  const gpr_cycle_counter last_call =
113  per_cpu_counter_data_storage_[core].last_call_started_cycle.load(
114  std::memory_order_relaxed);
115  if (last_call > out->last_call_started_cycle) {
116  out->last_call_started_cycle = last_call;
117  }
118  }
119 }
120 
123  CollectData(&data);
124  if (data.calls_started != 0) {
125  (*json)["callsStarted"] = std::to_string(data.calls_started);
127  gpr_cycle_counter_to_time(data.last_call_started_cycle),
129  (*json)["lastCallStartedTimestamp"] = gpr_format_timespec(ts);
130  }
131  if (data.calls_succeeded != 0) {
132  (*json)["callsSucceeded"] = std::to_string(data.calls_succeeded);
133  }
134  if (data.calls_failed) {
135  (*json)["callsFailed"] = std::to_string(data.calls_failed);
136  }
137 }
138 
139 //
140 // ChannelNode
141 //
142 
143 ChannelNode::ChannelNode(std::string target, size_t channel_tracer_max_nodes,
144  bool is_internal_channel)
145  : BaseNode(is_internal_channel ? EntityType::kInternalChannel
146  : EntityType::kTopLevelChannel,
147  target),
148  target_(std::move(target)),
149  trace_(channel_tracer_max_nodes) {}
150 
153  switch (state) {
154  case GRPC_CHANNEL_IDLE:
155  return "Channel state change to IDLE";
157  return "Channel state change to CONNECTING";
158  case GRPC_CHANNEL_READY:
159  return "Channel state change to READY";
161  return "Channel state change to TRANSIENT_FAILURE";
163  return "Channel state change to SHUTDOWN";
164  }
165  GPR_UNREACHABLE_CODE(return "UNKNOWN");
166 }
167 
169  Json::Object data = {
170  {"target", target_},
171  };
172  // Connectivity state.
173  // If low-order bit is on, then the field is set.
174  int state_field = connectivity_state_.load(std::memory_order_relaxed);
175  if ((state_field & 1) != 0) {
177  static_cast<grpc_connectivity_state>(state_field >> 1);
178  data["state"] = Json::Object{
179  {"state", ConnectivityStateName(state)},
180  };
181  }
182  // Fill in the channel trace if applicable.
183  Json trace_json = trace_.RenderJson();
184  if (trace_json.type() != Json::Type::JSON_NULL) {
185  data["trace"] = std::move(trace_json);
186  }
187  // Ask CallCountingHelper to populate call count data.
189  // Construct outer object.
190  Json::Object json = {
191  {"ref",
192  Json::Object{
193  {"channelId", std::to_string(uuid())},
194  }},
195  {"data", std::move(data)},
196  };
197  // Template method. Child classes may override this to add their specific
198  // functionality.
199  PopulateChildRefs(&json);
200  return json;
201 }
202 
204  MutexLock lock(&child_mu_);
205  if (!child_subchannels_.empty()) {
207  for (intptr_t subchannel_uuid : child_subchannels_) {
208  array.emplace_back(Json::Object{
209  {"subchannelId", std::to_string(subchannel_uuid)},
210  });
211  }
212  (*json)["subchannelRef"] = std::move(array);
213  }
214  if (!child_channels_.empty()) {
216  for (intptr_t channel_uuid : child_channels_) {
217  array.emplace_back(Json::Object{
218  {"channelId", std::to_string(channel_uuid)},
219  });
220  }
221  (*json)["channelRef"] = std::move(array);
222  }
223 }
224 
226  // Store with low-order bit set to indicate that the field is set.
227  int state_field = (state << 1) + 1;
228  connectivity_state_.store(state_field, std::memory_order_relaxed);
229 }
230 
232  MutexLock lock(&child_mu_);
233  child_channels_.insert(child_uuid);
234 }
235 
237  MutexLock lock(&child_mu_);
238  child_channels_.erase(child_uuid);
239 }
240 
242  MutexLock lock(&child_mu_);
243  child_subchannels_.insert(child_uuid);
244 }
245 
247  MutexLock lock(&child_mu_);
248  child_subchannels_.erase(child_uuid);
249 }
250 
251 //
252 // ServerNode
253 //
254 
255 ServerNode::ServerNode(size_t channel_tracer_max_nodes)
256  : BaseNode(EntityType::kServer, ""), trace_(channel_tracer_max_nodes) {}
257 
259 
261  MutexLock lock(&child_mu_);
262  child_sockets_.insert(std::make_pair(node->uuid(), std::move(node)));
263 }
264 
266  MutexLock lock(&child_mu_);
267  child_sockets_.erase(child_uuid);
268 }
269 
271  MutexLock lock(&child_mu_);
272  child_listen_sockets_.insert(std::make_pair(node->uuid(), std::move(node)));
273 }
274 
276  MutexLock lock(&child_mu_);
277  child_listen_sockets_.erase(child_uuid);
278 }
279 
281  intptr_t max_results) {
282  GPR_ASSERT(start_socket_id >= 0);
283  GPR_ASSERT(max_results >= 0);
284  // If user does not set max_results, we choose 500.
285  size_t pagination_limit = max_results == 0 ? 500 : max_results;
286  Json::Object object;
287  {
288  MutexLock lock(&child_mu_);
289  size_t sockets_rendered = 0;
290  // Create list of socket refs.
292  auto it = child_sockets_.lower_bound(start_socket_id);
293  for (; it != child_sockets_.end() && sockets_rendered < pagination_limit;
294  ++it, ++sockets_rendered) {
295  array.emplace_back(Json::Object{
296  {"socketId", std::to_string(it->first)},
297  {"name", it->second->name()},
298  });
299  }
300  object["socketRef"] = std::move(array);
301  if (it == child_sockets_.end()) object["end"] = true;
302  }
303  Json json = std::move(object);
304  return json.Dump();
305 }
306 
309  // Fill in the channel trace if applicable.
310  Json trace_json = trace_.RenderJson();
311  if (trace_json.type() != Json::Type::JSON_NULL) {
312  data["trace"] = std::move(trace_json);
313  }
314  // Ask CallCountingHelper to populate call count data.
316  // Construct top-level object.
317  Json::Object object = {
318  {"ref",
319  Json::Object{
320  {"serverId", std::to_string(uuid())},
321  }},
322  {"data", std::move(data)},
323  };
324  // Render listen sockets.
325  {
326  MutexLock lock(&child_mu_);
327  if (!child_listen_sockets_.empty()) {
329  for (const auto& it : child_listen_sockets_) {
330  array.emplace_back(Json::Object{
331  {"socketId", std::to_string(it.first)},
332  {"name", it.second->name()},
333  });
334  }
335  object["listenSocket"] = std::move(array);
336  }
337  }
338  return object;
339 }
340 
341 //
342 // SocketNode::Security::Tls
343 //
344 
347  if (type == NameType::kStandardName) {
348  data["standard_name"] = name;
349  } else if (type == NameType::kOtherName) {
350  data["other_name"] = name;
351  }
352  if (!local_certificate.empty()) {
353  data["local_certificate"] = absl::Base64Escape(local_certificate);
354  }
355  if (!remote_certificate.empty()) {
356  data["remote_certificate"] = absl::Base64Escape(remote_certificate);
357  }
358  return data;
359 }
360 
361 //
362 // SocketNode::Security
363 //
364 
367  switch (type) {
368  case ModelType::kUnset:
369  break;
370  case ModelType::kTls:
371  if (tls) {
372  data["tls"] = tls->RenderJson();
373  }
374  break;
375  case ModelType::kOther:
376  if (other) {
377  data["other"] = *other;
378  }
379  break;
380  }
381  return data;
382 }
383 
384 namespace {
385 
386 void* SecurityArgCopy(void* p) {
387  SocketNode::Security* xds_certificate_provider =
388  static_cast<SocketNode::Security*>(p);
389  return xds_certificate_provider->Ref().release();
390 }
391 
392 void SecurityArgDestroy(void* p) {
393  SocketNode::Security* xds_certificate_provider =
394  static_cast<SocketNode::Security*>(p);
395  xds_certificate_provider->Unref();
396 }
397 
398 int SecurityArgCmp(void* p, void* q) { return QsortCompare(p, q); }
399 
400 const grpc_arg_pointer_vtable kChannelArgVtable = {
401  SecurityArgCopy, SecurityArgDestroy, SecurityArgCmp};
402 
403 } // namespace
404 
407  const_cast<char*>(GRPC_ARG_CHANNELZ_SECURITY),
408  const_cast<SocketNode::Security*>(this), &kChannelArgVtable);
409 }
410 
412  const grpc_channel_args* args) {
413  Security* security = grpc_channel_args_find_pointer<Security>(
415  return security != nullptr ? security->Ref() : nullptr;
416 }
417 
418 //
419 // SocketNode
420 //
421 
422 namespace {
423 
424 void PopulateSocketAddressJson(Json::Object* json, const char* name,
425  const char* addr_str) {
426  if (addr_str == nullptr) return;
428  absl::StatusOr<URI> uri = URI::Parse(addr_str);
429  if (uri.ok() && (uri->scheme() == "ipv4" || uri->scheme() == "ipv6")) {
430  std::string host;
432  GPR_ASSERT(
433  SplitHostPort(absl::StripPrefix(uri->path(), "/"), &host, &port));
434  int port_num = -1;
435  if (!port.empty()) {
436  port_num = atoi(port.data());
437  }
438  grpc_resolved_address resolved_host;
440  grpc_string_to_sockaddr(&resolved_host, host.c_str(), port_num);
441  if (GRPC_ERROR_IS_NONE(error)) {
442  std::string packed_host = grpc_sockaddr_get_packed_host(&resolved_host);
443  std::string b64_host = absl::Base64Escape(packed_host);
444  data["tcpip_address"] = Json::Object{
445  {"port", port_num},
446  {"ip_address", b64_host},
447  };
448  (*json)[name] = std::move(data);
449  return;
450  }
452  }
453  if (uri.ok() && uri->scheme() == "unix") {
454  data["uds_address"] = Json::Object{
455  {"filename", uri->path()},
456  };
457  } else {
458  data["other_address"] = Json::Object{
459  {"name", addr_str},
460  };
461  }
462  (*json)[name] = std::move(data);
463 }
464 
465 } // namespace
466 
468  RefCountedPtr<Security> security)
469  : BaseNode(EntityType::kSocket, std::move(name)),
470  local_(std::move(local)),
471  remote_(std::move(remote)),
472  security_(std::move(security)) {}
473 
475  streams_started_.fetch_add(1, std::memory_order_relaxed);
476  last_local_stream_created_cycle_.store(gpr_get_cycle_counter(),
477  std::memory_order_relaxed);
478 }
479 
481  streams_started_.fetch_add(1, std::memory_order_relaxed);
482  last_remote_stream_created_cycle_.store(gpr_get_cycle_counter(),
483  std::memory_order_relaxed);
484 }
485 
487  messages_sent_.fetch_add(num_sent, std::memory_order_relaxed);
488  last_message_sent_cycle_.store(gpr_get_cycle_counter(),
489  std::memory_order_relaxed);
490 }
491 
493  messages_received_.fetch_add(1, std::memory_order_relaxed);
494  last_message_received_cycle_.store(gpr_get_cycle_counter(),
495  std::memory_order_relaxed);
496 }
497 
499  // Create and fill the data child.
501  gpr_timespec ts;
502  int64_t streams_started = streams_started_.load(std::memory_order_relaxed);
503  if (streams_started != 0) {
504  data["streamsStarted"] = std::to_string(streams_started);
505  gpr_cycle_counter last_local_stream_created_cycle =
506  last_local_stream_created_cycle_.load(std::memory_order_relaxed);
507  if (last_local_stream_created_cycle != 0) {
509  gpr_cycle_counter_to_time(last_local_stream_created_cycle),
511  data["lastLocalStreamCreatedTimestamp"] = gpr_format_timespec(ts);
512  }
513  gpr_cycle_counter last_remote_stream_created_cycle =
514  last_remote_stream_created_cycle_.load(std::memory_order_relaxed);
515  if (last_remote_stream_created_cycle != 0) {
517  gpr_cycle_counter_to_time(last_remote_stream_created_cycle),
519  data["lastRemoteStreamCreatedTimestamp"] = gpr_format_timespec(ts);
520  }
521  }
522  int64_t streams_succeeded =
523  streams_succeeded_.load(std::memory_order_relaxed);
524  if (streams_succeeded != 0) {
525  data["streamsSucceeded"] = std::to_string(streams_succeeded);
526  }
527  int64_t streams_failed = streams_failed_.load(std::memory_order_relaxed);
528  if (streams_failed != 0) {
529  data["streamsFailed"] = std::to_string(streams_failed);
530  }
531  int64_t messages_sent = messages_sent_.load(std::memory_order_relaxed);
532  if (messages_sent != 0) {
533  data["messagesSent"] = std::to_string(messages_sent);
536  last_message_sent_cycle_.load(std::memory_order_relaxed)),
538  data["lastMessageSentTimestamp"] = gpr_format_timespec(ts);
539  }
540  int64_t messages_received =
541  messages_received_.load(std::memory_order_relaxed);
542  if (messages_received != 0) {
543  data["messagesReceived"] = std::to_string(messages_received);
546  last_message_received_cycle_.load(std::memory_order_relaxed)),
548  data["lastMessageReceivedTimestamp"] = gpr_format_timespec(ts);
549  }
550  int64_t keepalives_sent = keepalives_sent_.load(std::memory_order_relaxed);
551  if (keepalives_sent != 0) {
552  data["keepAlivesSent"] = std::to_string(keepalives_sent);
553  }
554  // Create and fill the parent object.
555  Json::Object object = {
556  {"ref",
557  Json::Object{
558  {"socketId", std::to_string(uuid())},
559  {"name", name()},
560  }},
561  {"data", std::move(data)},
562  };
563  if (security_ != nullptr &&
565  object["security"] = security_->RenderJson();
566  }
567  PopulateSocketAddressJson(&object, "remote", remote_.c_str());
568  PopulateSocketAddressJson(&object, "local", local_.c_str());
569  return object;
570 }
571 
572 //
573 // ListenSocketNode
574 //
575 
577  : BaseNode(EntityType::kSocket, std::move(name)),
578  local_addr_(std::move(local_addr)) {}
579 
581  Json::Object object = {
582  {"ref",
583  Json::Object{
584  {"socketId", std::to_string(uuid())},
585  {"name", name()},
586  }},
587  };
588  PopulateSocketAddressJson(&object, "local", local_addr_.c_str());
589  return object;
590 }
591 
592 } // namespace channelz
593 } // namespace grpc_core
grpc_core::channelz::SocketNode::streams_failed_
std::atomic< int64_t > streams_failed_
Definition: channelz.h:337
grpc_core::Json::Array
std::vector< Json > Array
Definition: src/core/lib/json/json.h:55
grpc_arg
Definition: grpc_types.h:103
gpr_cpu_num_cores
GPRAPI unsigned gpr_cpu_num_cores(void)
GRPC_CHANNEL_READY
@ GRPC_CHANNEL_READY
Definition: include/grpc/impl/codegen/connectivity_state.h:36
gen_build_yaml.out
dictionary out
Definition: src/benchmark/gen_build_yaml.py:24
grpc_core::channelz::ChannelNode::child_mu_
Mutex child_mu_
Definition: channelz.h:233
regen-readme.it
it
Definition: regen-readme.py:15
log.h
sockaddr_utils.h
grpc_core::channelz::SocketNode::Security
Definition: channelz.h:285
grpc_core::channelz::ChannelNode::AddChildSubchannel
void AddChildSubchannel(intptr_t child_uuid)
Definition: src/core/lib/channel/channelz.cc:241
grpc_core::Json::type
Type type() const
Definition: src/core/lib/json/json.h:174
connectivity_state.h
grpc_core::channelz::SocketNode::SocketNode
SocketNode(std::string local, std::string remote, std::string name, RefCountedPtr< Security > security)
Definition: src/core/lib/channel/channelz.cc:467
grpc_core::channelz::ChannelTrace::RenderJson
Json RenderJson() const
Definition: channel_trace.cc:162
grpc_core::channelz::ChannelNode::RemoveChildChannel
void RemoveChildChannel(intptr_t child_uuid)
Definition: src/core/lib/channel/channelz.cc:236
grpc_core::channelz::CallCountingHelper::per_cpu_counter_data_storage_
std::vector< AtomicCounterData > per_cpu_counter_data_storage_
Definition: channelz.h:173
grpc_core::channelz::SocketNode::RecordMessagesSent
void RecordMessagesSent(uint32_t num_sent)
Definition: src/core/lib/channel/channelz.cc:486
grpc_core
Definition: call_metric_recorder.h:31
grpc_core::channelz::SocketNode::Security::ModelType::kOther
@ kOther
grpc_core::MutexLock
Definition: src/core/lib/gprpp/sync.h:88
grpc_core::channelz::BaseNode::~BaseNode
~BaseNode() override
Definition: src/core/lib/channel/channelz.cc:65
grpc_core::channelz::SocketNode::streams_started_
std::atomic< int64_t > streams_started_
Definition: channelz.h:335
string.h
array
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern array
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/array.c:111
useful.h
grpc_core::channelz::SocketNode::RecordStreamStartedFromRemote
void RecordStreamStartedFromRemote()
Definition: src/core/lib/channel/channelz.cc:480
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
error
grpc_error_handle error
Definition: retry_filter.cc:499
grpc_core::channelz::SocketNode::messages_received_
std::atomic< int64_t > messages_received_
Definition: channelz.h:339
type_
std::string type_
Definition: client_channel_stress_test.cc:212
gpr_cycle_counter_to_time
gpr_timespec gpr_cycle_counter_to_time(gpr_cycle_counter cycles)
grpc_core::channelz::BaseNode::name
const std::string & name() const
Definition: channelz.h:106
GRPC_CHANNEL_TRANSIENT_FAILURE
@ GRPC_CHANNEL_TRANSIENT_FAILURE
Definition: include/grpc/impl/codegen/connectivity_state.h:38
grpc_resolved_address
Definition: resolved_address.h:34
u
OPENSSL_EXPORT pem_password_cb void * u
Definition: pem.h:351
grpc_core::SplitHostPort
bool SplitHostPort(absl::string_view name, absl::string_view *host, absl::string_view *port)
Definition: host_port.cc:88
grpc_core::channelz::SocketNode::Security::Tls::remote_certificate
std::string remote_certificate
Definition: channelz.h:295
setup.name
name
Definition: setup.py:542
time.h
absl::StripPrefix
ABSL_MUST_USE_RESULT absl::string_view StripPrefix(absl::string_view str, absl::string_view prefix)
Definition: abseil-cpp/absl/strings/strip.h:73
grpc_core::channelz::ServerNode::RemoveChildListenSocket
void RemoveChildListenSocket(intptr_t child_uuid)
Definition: src/core/lib/channel/channelz.cc:275
grpc_core::channelz::SocketNode::security_
const RefCountedPtr< Security > security_
Definition: channelz.h:347
grpc_core::channelz::CallCountingHelper::CallCountingHelper
CallCountingHelper()
Definition: src/core/lib/channel/channelz.cc:76
resolved_address.h
grpc_core::channelz::SocketNode::Security::Tls::RenderJson
Json RenderJson()
Definition: src/core/lib/channel/channelz.cc:345
name_
const std::string name_
Definition: priority.cc:233
grpc_core::URI::Parse
static absl::StatusOr< URI > Parse(absl::string_view uri_text)
Definition: uri_parser.cc:209
channelz.h
grpc_core::channelz::CallCountingHelper::PopulateCallCounts
void PopulateCallCounts(Json::Object *json)
Definition: src/core/lib/channel/channelz.cc:121
grpc_core::channelz::SocketNode::RecordStreamStartedFromLocal
void RecordStreamStartedFromLocal()
Definition: src/core/lib/channel/channelz.cc:474
grpc_arg_pointer_vtable
Definition: grpc_types.h:85
grpc_channel_args
Definition: grpc_types.h:132
grpc_core::channelz::SocketNode::remote
const std::string & remote()
Definition: channelz.h:332
grpc_core::channelz::CallCountingHelper::RecordCallFailed
void RecordCallFailed()
Definition: src/core/lib/channel/channelz.cc:92
grpc_core::channelz::SocketNode::Security::RenderJson
Json RenderJson()
Definition: src/core/lib/channel/channelz.cc:365
grpc_core::channelz::SocketNode::Security::Tls::NameType::kStandardName
@ kStandardName
grpc_core::channelz::ServerNode::call_counter_
CallCountingHelper call_counter_
Definition: channelz.h:273
grpc_connectivity_state
grpc_connectivity_state
Definition: include/grpc/impl/codegen/connectivity_state.h:30
grpc_core::channelz::ServerNode::child_mu_
Mutex child_mu_
Definition: channelz.h:275
grpc_core::channelz::ListenSocketNode::local_addr_
std::string local_addr_
Definition: channelz.h:359
grpc_core::channelz::ChannelNode::SetConnectivityState
void SetConnectivityState(grpc_connectivity_state state)
Definition: src/core/lib/channel/channelz.cc:225
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
grpc_core::RefCounted::Unref
void Unref()
Definition: ref_counted.h:302
grpc_core::channelz::BaseNode::BaseNode
BaseNode(EntityType type, std::string name)
Definition: src/core/lib/channel/channelz.cc:59
parse_address.h
channelz_registry.h
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
grpc_core::channelz::SocketNode::RenderJson
Json RenderJson() override
Definition: src/core/lib/channel/channelz.cc:498
grpc_sockaddr_get_packed_host
std::string grpc_sockaddr_get_packed_host(const grpc_resolved_address *resolved_addr)
Definition: sockaddr_utils.cc:344
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
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
array
Definition: undname.c:101
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
max
int max
Definition: bloaty/third_party/zlib/examples/enough.c:170
Json
JSON (JavaScript Object Notation).
Definition: third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h:227
grpc_core::channelz::BaseNode::EntityType
EntityType
Definition: channelz.h:83
grpc_string_to_sockaddr
grpc_error_handle grpc_string_to_sockaddr(grpc_resolved_address *out, const char *addr, int port)
Definition: parse_address.cc:320
grpc_core::channelz::ServerNode::RemoveChildSocket
void RemoveChildSocket(intptr_t child_uuid)
Definition: src/core/lib/channel/channelz.cc:265
grpc_core::channelz::CallCountingHelper::RecordCallStarted
void RecordCallStarted()
Definition: src/core/lib/channel/channelz.cc:84
grpc_core::channelz::ChannelNode::AddChildChannel
void AddChildChannel(intptr_t child_uuid)
Definition: src/core/lib/channel/channelz.cc:231
grpc_core::channelz::ChannelNode::connectivity_state_
std::atomic< int > connectivity_state_
Definition: channelz.h:231
grpc_core::channelz::ChannelNode::GetChannelConnectivityStateChangeString
static const char * GetChannelConnectivityStateChangeString(grpc_connectivity_state state)
Definition: src/core/lib/channel/channelz.cc:151
grpc_core::channelz::BaseNode::uuid_
intptr_t uuid_
Definition: channelz.h:112
grpc_core::channelz::SocketNode::last_message_sent_cycle_
std::atomic< gpr_cycle_counter > last_message_sent_cycle_
Definition: channelz.h:343
grpc_core::channelz::ServerNode::trace_
ChannelTrace trace_
Definition: channelz.h:274
grpc_core::channelz::BaseNode
Definition: channelz.h:78
grpc_core::channelz::SocketNode::streams_succeeded_
std::atomic< int64_t > streams_succeeded_
Definition: channelz.h:336
grpc_core::channelz::ChannelzRegistry::Unregister
static void Unregister(intptr_t uuid)
Definition: channelz_registry.h:42
GRPC_CHANNEL_IDLE
@ GRPC_CHANNEL_IDLE
Definition: include/grpc/impl/codegen/connectivity_state.h:32
gpr_format_timespec
std::string gpr_format_timespec(gpr_timespec tm)
Definition: string.cc:55
cpu.h
grpc_core::channelz::SocketNode::RecordMessageReceived
void RecordMessageReceived()
Definition: src/core/lib/channel/channelz.cc:492
grpc_core::channelz::ListenSocketNode::ListenSocketNode
ListenSocketNode(std::string local_addr, std::string name)
Definition: src/core/lib/channel/channelz.cc:576
grpc_core::channelz::ChannelNode::RenderJson
Json RenderJson() override
Definition: src/core/lib/channel/channelz.cc:168
grpc_core::channelz::SocketNode::Security::Tls::name
std::string name
Definition: channelz.h:293
intptr_t
_W64 signed int intptr_t
Definition: stdint-msvc2008.h:118
grpc_core::channelz::CallCountingHelper::CollectData
void CollectData(CounterData *out)
Definition: src/core/lib/channel/channelz.cc:102
grpc_core::channelz::ServerNode::AddChildSocket
void AddChildSocket(RefCountedPtr< SocketNode > node)
Definition: src/core/lib/channel/channelz.cc:260
grpc_core::channelz::ChannelNode::target_
std::string target_
Definition: channelz.h:225
error.h
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
host_port.h
grpc_core::channelz::ServerNode::RenderJson
Json RenderJson() override
Definition: src/core/lib/channel/channelz.cc:307
grpc_core::channelz::SocketNode::Security::Tls::NameType::kOtherName
@ kOtherName
GPR_UNREACHABLE_CODE
#define GPR_UNREACHABLE_CODE(STATEMENT)
Definition: impl/codegen/port_platform.h:652
grpc_core::channelz::CallCountingHelper::CounterData
Definition: channelz.h:163
grpc_core::channelz::ChannelzRegistry::Register
static void Register(BaseNode *node)
Definition: channelz_registry.h:39
grpc_core::channelz::SocketNode::keepalives_sent_
std::atomic< int64_t > keepalives_sent_
Definition: channelz.h:340
grpc_core::channelz::ChannelNode::child_channels_
std::set< intptr_t > child_channels_
Definition: channelz.h:234
grpc_core::channelz::SocketNode::Security::GetFromChannelArgs
static RefCountedPtr< Security > GetFromChannelArgs(const grpc_channel_args *args)
Definition: src/core/lib/channel/channelz.cc:411
gpr_types.h
GRPC_CHANNEL_CONNECTING
@ GRPC_CHANNEL_CONNECTING
Definition: include/grpc/impl/codegen/connectivity_state.h:34
tests.unit._exit_scenarios.port
port
Definition: _exit_scenarios.py:179
grpc_core::channelz::ServerNode::~ServerNode
~ServerNode() override
Definition: src/core/lib/channel/channelz.cc:258
grpc_core::channelz::SocketNode::Security::tls
absl::optional< Tls > tls
Definition: channelz.h:301
grpc_core::channelz::SocketNode::last_local_stream_created_cycle_
std::atomic< gpr_cycle_counter > last_local_stream_created_cycle_
Definition: channelz.h:341
grpc_core::channelz::BaseNode::uuid
intptr_t uuid() const
Definition: channelz.h:105
grpc_core::channelz::SocketNode::Security::type
ModelType type
Definition: channelz.h:300
grpc_core::channelz::SocketNode::local_
std::string local_
Definition: channelz.h:345
grpc_core::Json::Object
std::map< std::string, Json > Object
Definition: src/core/lib/json/json.h:54
grpc_core::channelz::BaseNode::RenderJsonString
std::string RenderJsonString()
Definition: src/core/lib/channel/channelz.cc:67
absl::StatusOr::ok
ABSL_MUST_USE_RESULT bool ok() const
Definition: abseil-cpp/absl/status/statusor.h:491
grpc_core::channelz::SocketNode::Security::ModelType::kUnset
@ kUnset
grpc_core::ConnectivityStateName
const char * ConnectivityStateName(grpc_connectivity_state state)
Definition: connectivity_state.cc:38
GRPC_ARG_CHANNELZ_SECURITY
#define GRPC_ARG_CHANNELZ_SECURITY
Definition: channelz.h:280
grpc_core::channelz::SocketNode::last_message_received_cycle_
std::atomic< gpr_cycle_counter > last_message_received_cycle_
Definition: channelz.h:344
grpc_core::QsortCompare
int QsortCompare(const T &a, const T &b)
Definition: useful.h:95
gpr_convert_clock_type
GPRAPI gpr_timespec gpr_convert_clock_type(gpr_timespec t, gpr_clock_type clock_type)
Definition: src/core/lib/gpr/time.cc:241
grpc_core::channelz::ChannelNode::child_subchannels_
std::set< intptr_t > child_subchannels_
Definition: channelz.h:235
grpc_core::channelz::SocketNode::messages_sent_
std::atomic< int64_t > messages_sent_
Definition: channelz.h:338
grpc_core::channelz::SocketNode::remote_
std::string remote_
Definition: channelz.h:346
grpc_core::Json::Type::JSON_NULL
@ JSON_NULL
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
grpc_core::channelz::ServerNode::RenderServerSockets
std::string RenderServerSockets(intptr_t start_socket_id, intptr_t max_results)
Definition: src/core/lib/channel/channelz.cc:280
grpc_core::channelz::SocketNode::last_remote_stream_created_cycle_
std::atomic< gpr_cycle_counter > last_remote_stream_created_cycle_
Definition: channelz.h:342
grpc_core::channelz::ServerNode::ServerNode
ServerNode(size_t channel_tracer_max_nodes)
Definition: src/core/lib/channel/channelz.cc:255
grpc_core::ExecCtx::starting_cpu
unsigned starting_cpu()
Definition: exec_ctx.h:128
grpc_core::channelz::SocketNode::Security::MakeChannelArg
grpc_arg MakeChannelArg() const
Definition: src/core/lib/channel/channelz.cc:405
state
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:41
exec_ctx.h
grpc_core::channelz::CallCountingHelper::num_cores_
size_t num_cores_
Definition: channelz.h:174
local
#define local
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:36
channelz
void channelz(grpc_end2end_test_config config)
Definition: test/core/end2end/tests/channelz.cc:318
grpc_core::channelz::ListenSocketNode::RenderJson
Json RenderJson() override
Definition: src/core/lib/channel/channelz.cc:580
grpc_core::channelz::ChannelNode::ChannelNode
ChannelNode(std::string target, size_t channel_tracer_max_nodes, bool is_internal_channel)
Definition: src/core/lib/channel/channelz.cc:143
GRPC_ERROR_UNREF
#define GRPC_ERROR_UNREF(err)
Definition: error.h:262
grpc_core::FilterEndpoint::kServer
@ kServer
grpc_core::channelz::ChannelNode::trace_
ChannelTrace trace_
Definition: channelz.h:227
grpc_core::channelz::SocketNode::Security::Tls::type
NameType type
Definition: channelz.h:291
grpc_core::channelz::CallCountingHelper::AtomicCounterData
Definition: channelz.h:138
channel_args.h
grpc_core::channelz::CallCountingHelper::RecordCallSucceeded
void RecordCallSucceeded()
Definition: src/core/lib/channel/channelz.cc:97
grpc_core::channelz::ChannelNode::PopulateChildRefs
void PopulateChildRefs(Json::Object *json)
Definition: src/core/lib/channel/channelz.cc:203
grpc_core::channelz::ChannelNode::RemoveChildSubchannel
void RemoveChildSubchannel(intptr_t child_uuid)
Definition: src/core/lib/channel/channelz.cc:246
grpc_core::channelz::ServerNode::child_sockets_
std::map< intptr_t, RefCountedPtr< SocketNode > > child_sockets_
Definition: channelz.h:276
grpc_core::channelz::SocketNode::Security::ModelType::kTls
@ kTls
absl::Base64Escape
void Base64Escape(absl::string_view src, std::string *dest)
Definition: abseil-cpp/absl/strings/escaping.cc:904
GRPC_CHANNEL_SHUTDOWN
@ GRPC_CHANNEL_SHUTDOWN
Definition: include/grpc/impl/codegen/connectivity_state.h:40
absl::StatusOr
Definition: abseil-cpp/absl/status/statusor.h:187
grpc_core::channelz::ServerNode::AddChildListenSocket
void AddChildListenSocket(RefCountedPtr< ListenSocketNode > node)
Definition: src/core/lib/channel/channelz.cc:270
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
uri_parser.h
gpr_timespec
Definition: gpr_types.h:50
grpc_error
Definition: error_internal.h:42
GPR_CLOCK_REALTIME
@ GPR_CLOCK_REALTIME
Definition: gpr_types.h:39
to_string
static bool to_string(zval *from)
Definition: protobuf/php/ext/google/protobuf/convert.c:333
grpc_channel_arg_pointer_create
grpc_arg grpc_channel_arg_pointer_create(char *name, void *value, const grpc_arg_pointer_vtable *vtable)
Definition: channel_args.cc:492
grpc_core::channelz::ServerNode::child_listen_sockets_
std::map< intptr_t, RefCountedPtr< ListenSocketNode > > child_listen_sockets_
Definition: channelz.h:277
setup.target
target
Definition: third_party/bloaty/third_party/protobuf/python/setup.py:179
grpc_core::channelz::BaseNode::RenderJson
virtual Json RenderJson()=0
grpc_core::channelz::ChannelNode::call_counter_
CallCountingHelper call_counter_
Definition: channelz.h:226
grpc_core::Json::Dump
std::string Dump(int indent=0) const
Definition: json_writer.cc:336
grpc_core::ExecCtx::Get
static ExecCtx * Get()
Definition: exec_ctx.h:205
target_
std::string target_
Definition: rls.cc:342
grpc_core::RefCounted::Ref
RefCountedPtr< Child > Ref() GRPC_MUST_USE_RESULT
Definition: ref_counted.h:287
grpc_core::channelz::SocketNode::Security::other
absl::optional< Json > other
Definition: channelz.h:302
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
grpc_core::channelz::SocketNode::Security::Tls::local_certificate
std::string local_certificate
Definition: channelz.h:294
GRPC_ERROR_IS_NONE
#define GRPC_ERROR_IS_NONE(err)
Definition: error.h:241
port_platform.h


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