#include "ProtocolV2.h"
+#include <seastar/core/lowres_clock.hh>
+
#include "include/msgr.h"
#include "include/random.h"
{
return read_frame_payload()
.then([this, throttle_stamp] {
- utime_t recv_stamp = ceph_clock_now();
+ utime_t recv_stamp{seastar::lowres_system_clock::now()};
// we need to get the size before std::moving segments data
const size_t cur_msg_size = get_current_msg_size();
message->set_throttle_stamp(throttle_stamp);
message->set_recv_stamp(recv_stamp);
- message->set_recv_complete_stamp(ceph_clock_now());
+ message->set_recv_complete_stamp(utime_t{seastar::lowres_system_clock::now()});
// check received seq#. if it is old, drop the message.
// note that incoming messages may skip ahead. this is convenient for the
return conn.policy.throttler_bytes->get(cur_msg_size);
}).then([this] {
// TODO: throttle_dispatch_queue() logic
- utime_t throttle_stamp = ceph_clock_now();
+ utime_t throttle_stamp{seastar::lowres_system_clock::now()};
return read_message(throttle_stamp);
});
}
last_keepalive_ack_to_send = keepalive_frame.timestamp();
logger().debug("{} got KEEPALIVE2 {}",
conn, last_keepalive_ack_to_send);
- conn.last_keepalive = ceph_clock_now();
+ conn.last_keepalive = utime_t{seastar::lowres_system_clock::now()};
notify_keepalive_ack();
});
case Tag::KEEPALIVE2_ACK:
#include <time.h>
#include <errno.h>
+#if defined(WITH_SEASTAR)
+#include <seastar/core/lowres_clock.hh>
+#endif
+
#include "include/types.h"
#include "include/timegm.h"
#include "common/strtol.h"
explicit utime_t(const std::chrono::time_point<Clock>& t)
: utime_t(Clock::to_timespec(t)) {} // forward to timespec ctor
+#if defined(WITH_SEASTAR)
+ explicit utime_t(const seastar::lowres_system_clock::time_point& t) {
+ tv.tv_sec = std::time_t(std::chrono::duration_cast<std::chrono::seconds>(
+ t.time_since_epoch()).count());
+ tv.tv_nsec = std::chrono::duration_cast<std::chrono::nanoseconds>(
+ t.time_since_epoch() % std::chrono::seconds(1)).count();
+ }
+#endif
+
utime_t(const struct timeval &v) {
set_from_timeval(&v);
}