| 248 | } |
| 249 | |
| 250 | Status Monitor(const tensorflow::string& service_addr, int duration_ms, |
| 251 | int monitoring_level, bool display_timestamp, string* result) { |
| 252 | MonitorRequest request = |
| 253 | PopulateMonitorRequest(duration_ms, monitoring_level, display_timestamp); |
| 254 | |
| 255 | ::grpc::ClientContext context; |
| 256 | ::grpc::ChannelArguments channel_args; |
| 257 | channel_args.SetInt(GRPC_ARG_MAX_MESSAGE_LENGTH, |
| 258 | std::numeric_limits<int32>::max()); |
| 259 | std::unique_ptr<grpc::ProfilerService::Stub> stub = |
| 260 | grpc::ProfilerService::NewStub(::grpc::CreateCustomChannel( |
| 261 | "dns:///" + service_addr, ::grpc::InsecureChannelCredentials(), |
| 262 | channel_args)); |
| 263 | MonitorResponse response; |
| 264 | TF_RETURN_IF_ERROR( |
| 265 | FromGrpcStatus(stub->Monitor(&context, request, &response))); |
| 266 | *result = response.data(); |
| 267 | return Status::OK(); |
| 268 | } |
| 269 | |
| 270 | } // namespace client |
| 271 | } // namespace profiler |
nothing calls this directly
no test coverage detected