1 /* Copyright 2017 The TensorFlow Authors All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 // GRPC client to perform on-demand profiling 16 17 #ifndef TENSORFLOW_CORE_PROFILER_RPC_CLIENT_CAPTURE_PROFILE_H_ 18 #define TENSORFLOW_CORE_PROFILER_RPC_CLIENT_CAPTURE_PROFILE_H_ 19 20 #include "tensorflow/core/lib/core/status.h" 21 22 namespace tensorflow { 23 namespace profiler { 24 namespace client { 25 26 Status ValidateHostPortPair(const string& host_port); 27 28 // Repeatedly collects profiles and shows user-friendly metrics for 29 // 'num_queries' time(s). 30 void StartMonitoring(const tensorflow::string& service_addr, int duration_ms, 31 int monitoring_level, int num_queries); 32 33 // Starts tracing on a single or multiple hosts and saves the result in the 34 // given logdir. If no trace was collected, retries tracing for 35 // num_tracing_attempts. 36 Status StartTracing(const tensorflow::string& service_addr, 37 const tensorflow::string& logdir, 38 const tensorflow::string& workers_list, 39 bool include_dataset_ops, int duration_ms, 40 int num_tracing_attempts); 41 42 } // namespace client 43 } // namespace profiler 44 } // namespace tensorflow 45 46 #endif // TENSORFLOW_CORE_PROFILER_RPC_CLIENT_CAPTURE_PROFILE_H_ 47