Add in traces for GCS buffer loading.

PiperOrigin-RevId: 323832189
Change-Id: I801261b1488da9ea933203d0328b05f4037bd7a4
This commit is contained in:
Amit Patankar 2020-07-29 11:37:33 -07:00 committed by TensorFlower Gardener
parent aa462dd250
commit 233d855f9c
2 changed files with 0 additions and 9 deletions

View File

@ -103,8 +103,6 @@ cc_library(
"//tensorflow/core/platform:retrying_utils",
"//tensorflow/core/platform:str_util",
"//tensorflow/core/platform:stringprintf",
"//tensorflow/core/profiler/lib:traceme",
"@com_google_absl//absl/strings:str_format",
"@jsoncpp_git//:jsoncpp",
],
alwayslink = 1,

View File

@ -47,7 +47,6 @@ limitations under the License.
#include "tensorflow/core/platform/str_util.h"
#include "tensorflow/core/platform/stringprintf.h"
#include "tensorflow/core/platform/thread_annotations.h"
#include "tensorflow/core/profiler/lib/traceme.h"
#ifdef _WIN32
#ifdef DeleteFile
@ -1071,9 +1070,6 @@ Status GcsFileSystem::LoadBufferFromGCS(const string& fname, size_t offset,
string bucket, object;
TF_RETURN_IF_ERROR(ParseGcsPath(fname, false, &bucket, &object));
profiler::TraceMe activity(
[fname]() { return absl::StrCat("LoadBufferFromGCS ", fname); });
std::unique_ptr<HttpRequest> request;
TF_RETURN_WITH_CONTEXT_IF_ERROR(CreateHttpRequest(&request),
"when reading gs://", bucket, "/", object);
@ -1095,9 +1091,6 @@ Status GcsFileSystem::LoadBufferFromGCS(const string& fname, size_t offset,
*bytes_transferred = bytes_read;
VLOG(1) << "Successful read of gs://" << bucket << "/" << object << " @ "
<< offset << " of size: " << bytes_read;
activity.AppendMetadata([bytes_read]() {
return profiler::TraceMeEncode({{"block_size", bytes_read}});
});
if (stats_ != nullptr) {
stats_->RecordBlockRetrieved(fname, offset, bytes_read);