MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Connect

Method Connect

tensorflow/core/debug/debug_io_utils.cc:732–750  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730 url_(strings::StrCat(DebugIO::kGrpcURLScheme, server_stream_addr)) {}
731
732Status DebugGrpcChannel::Connect(const int64 timeout_micros) {
733 ::grpc::ChannelArguments args;
734 args.SetInt(GRPC_ARG_MAX_MESSAGE_LENGTH, std::numeric_limits<int32>::max());
735 // Avoid problems where default reconnect backoff is too long (e.g., 20 s).
736 args.SetInt(GRPC_ARG_MAX_RECONNECT_BACKOFF_MS, 1000);
737 channel_ = ::grpc::CreateCustomChannel(
738 server_stream_addr_, ::grpc::InsecureChannelCredentials(), args);
739 if (!channel_->WaitForConnected(
740 gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
741 gpr_time_from_micros(timeout_micros, GPR_TIMESPAN)))) {
742 return errors::FailedPrecondition(
743 "Failed to connect to gRPC channel at ", server_stream_addr_,
744 " within a timeout of ", timeout_micros / 1e6, " s.");
745 }
746 stub_ = EventListener::NewStub(channel_);
747 reader_writer_ = stub_->SendEvents(&ctx_);
748
749 return Status::OK();
750}
751
752bool DebugGrpcChannel::WriteEvent(const Event& event) {
753 mutex_lock l(mu_);

Callers 1

Calls 3

FailedPreconditionFunction · 0.85
maxFunction · 0.50
SendEventsMethod · 0.45

Tested by

no test coverage detected