Skip to content

Commit

Permalink
Merge pull request xrootd#7 from ericcano/master
Browse files Browse the repository at this point in the history
Fixed logs for read case.
  • Loading branch information
simonmichal committed Oct 2, 2020
2 parents f93989b + 8ceb998 commit f8ec279
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/XrdCeph/XrdCephPosix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -676,16 +676,20 @@ int ceph_posix_close(int fd) {
::timeval now;
::gettimeofday(&now, nullptr);
XrdSysMutexHelper lock(fr->statsMutex);
double lastAsyncAge = 1.0 * (now.tv_sec - fr->lastAsyncSubmission.tv_sec)
+ 0.000001 * (now.tv_usec - fr->lastAsyncSubmission.tv_usec);
double lastAsyncAge = 0.0;
// Only compute an age if the starting point was set.
if (fr->lastAsyncSubmission.tv_sec && fr->lastAsyncSubmission.tv_usec) {
lastAsyncAge = 1.0 * (now.tv_sec - fr->lastAsyncSubmission.tv_sec)
+ 0.000001 * (now.tv_usec - fr->lastAsyncSubmission.tv_usec);
}
logwrapper((char*)"ceph_close: closed fd %d for file %s, read ops count %d, write ops count %d, "
"async write ops %d/%d, async pending write bytes %ld, "
"async read ops %d/%d, bytes written/max offset %ld/%ld, "
"longest async write %f, longest callback invocation %f, last async op age %f",
fd, fr->name.c_str(), fr->rdcount, fr->wrcount,
fr->asyncWrCompletionCount, fr->asyncWrStartCount, fr->bytesAsyncWritePending,
fr->asyncRdCompletionCount, fr->asyncRdStartCount, fr->bytesWritten, fr->maxOffsetWritten,
fr->longestAsyncWriteTime, fr->longestCallbackInvocation, lastAsyncAge);
fr->longestAsyncWriteTime, fr->longestCallbackInvocation, (lastAsyncAge));
deleteFileRef(fd, *fr);
return 0;
} else {
Expand Down

0 comments on commit f8ec279

Please sign in to comment.