diff options
author | Adam C. Emerson <aemerson@redhat.com> | 2017-10-06 23:15:43 +0200 |
---|---|---|
committer | Adam C. Emerson <aemerson@redhat.com> | 2017-10-07 02:49:53 +0200 |
commit | afaf48a2636a46084279d1c6076aa67c3fe12136 (patch) | |
tree | a2f0d29894cd2f935a209795ae24349503121e21 /src/common/ceph_time.cc | |
parent | log: Add log_coarse_timestamps option (diff) | |
download | ceph-afaf48a2636a46084279d1c6076aa67c3fe12136.tar.xz ceph-afaf48a2636a46084279d1c6076aa67c3fe12136.zip |
log: Mark timestamps for coarseness and print appropriately
Have each timestamp know whether it's coarse or fine. Print six figures
for fine stamps and three for coarse.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Diffstat (limited to 'src/common/ceph_time.cc')
-rw-r--r-- | src/common/ceph_time.cc | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/common/ceph_time.cc b/src/common/ceph_time.cc index f5072b7923d..a5c630a1786 100644 --- a/src/common/ceph_time.cc +++ b/src/common/ceph_time.cc @@ -84,25 +84,6 @@ namespace ceph { } - namespace logging { - void log_clock::to_ceph_timespec(const time_point& t, - struct ceph_timespec& ts) { - ts.tv_sec = to_time_t(t); - ts.tv_nsec = (t.time_since_epoch() %std::chrono::seconds(1)).count(); - } - struct ceph_timespec log_clock::to_ceph_timespec( - const time_point& t) { - struct ceph_timespec ts; - to_ceph_timespec(t, ts); - return ts; - } - log_clock::time_point log_clock::from_ceph_timespec( - const struct ceph_timespec& ts) { - return time_point(std::chrono::seconds(ts.tv_sec) + - std::chrono::nanoseconds(ts.tv_nsec)); - } - } - using std::chrono::duration_cast; using std::chrono::seconds; using std::chrono::microseconds; @@ -153,6 +134,4 @@ namespace ceph { operator<< <coarse_mono_clock>(std::ostream& m, const coarse_mono_time& t); template std::ostream& operator<< <coarse_real_clock>(std::ostream& m, const coarse_real_time& t); - template std::ostream& - operator<< <logging::log_clock>(std::ostream& m, const logging::log_time& t); } |