Skip to content

Instantly share code, notes, and snippets.

@ErwanAliasr1
Last active January 19, 2016 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ErwanAliasr1/f74f7f046e9300ac2c30 to your computer and use it in GitHub Desktop.
Save ErwanAliasr1/f74f7f046e9300ac2c30 to your computer and use it in GitHub Desktop.
diff --git a/src/client/Client.cc b/src/client/Client.cc
index ed67f58..00b3c00 100644
--- a/src/client/Client.cc
+++ b/src/client/Client.cc
@@ -8253,7 +8253,7 @@ int Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf,
ldout(cct, 10) << "cur file size is " << in->size << dendl;
// time it.
- utime_t start = ceph_clock_now(cct);
+ ceph::mono_time start = ceph::time_detail::coarse_mono_clock::now();
if (in->inline_version == 0) {
int r = _getattr(in, CEPH_STAT_CAP_INLINE_DATA, -1, -1, true);
@@ -8280,7 +8280,7 @@ int Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf,
}
}
- utime_t lat;
+ ceph::mono_time lat;
uint64_t totalwritten;
int have;
int r = get_caps(in, CEPH_CAP_FILE_WR, CEPH_CAP_FILE_BUFFER, &have, endoff);
@@ -8385,9 +8385,8 @@ int Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf,
// if we get here, write was successful, update client metadata
success:
// time
- lat = ceph_clock_now(cct);
- lat -= start;
- logger->tinc(l_c_wrlat, lat);
+ lat = ceph::time_detail::coarse_mono_clock::now();
+ logger->tinc(l_c_wrlat, lat - start);
totalwritten = size;
r = (int)totalwritten;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment