kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [3/6] kudu git commit: monotime: remove granularity argument
Date Sun, 14 Aug 2016 22:34:26 GMT
http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/rpc/rpc_controller.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_controller.cc b/src/kudu/rpc/rpc_controller.cc
index 97bd262..ae02b0a 100644
--- a/src/kudu/rpc/rpc_controller.cc
+++ b/src/kudu/rpc/rpc_controller.cc
@@ -87,7 +87,7 @@ void RpcController::set_timeout(const MonoDelta& timeout) {
 }
 
 void RpcController::set_deadline(const MonoTime& deadline) {
-  set_timeout(deadline.GetDeltaSince(MonoTime::Now(MonoTime::FINE)));
+  set_timeout(deadline.GetDeltaSince(MonoTime::Now()));
 }
 
 void RpcController::SetRequestIdPB(std::unique_ptr<RequestIdPB> request_id) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/rpc/rpc_stub-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/rpc_stub-test.cc b/src/kudu/rpc/rpc_stub-test.cc
index d989aa9..71f68a6 100644
--- a/src/kudu/rpc/rpc_stub-test.cc
+++ b/src/kudu/rpc/rpc_stub-test.cc
@@ -416,7 +416,7 @@ TEST_F(RpcStubTest, TestEarliestDeadlineFirstQueue) {
         while (!done.load()) {
           // Set a deadline in the future. We'll keep using this same deadline
           // on each of our retries.
-          MonoTime deadline = MonoTime::Now(MonoTime::FINE);
+          MonoTime deadline = MonoTime::Now();
           deadline.AddDelta(MonoDelta::FromSeconds(8));
 
           for (int attempt = 1; !done.load(); attempt++) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/rpc/sasl_rpc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/sasl_rpc-test.cc b/src/kudu/rpc/sasl_rpc-test.cc
index ce588a5..b07254d 100644
--- a/src/kudu/rpc/sasl_rpc-test.cc
+++ b/src/kudu/rpc/sasl_rpc-test.cc
@@ -175,7 +175,7 @@ static void RunTimeoutNegotiationClient(Socket* sock) {
   SaslClient sasl_client(kSaslAppName, sock->GetFd());
   CHECK_OK(sasl_client.Init(kSaslAppName));
   CHECK_OK(sasl_client.EnableAnonymous());
-  MonoTime deadline = MonoTime::Now(MonoTime::FINE);
+  MonoTime deadline = MonoTime::Now();
   deadline.AddDelta(MonoDelta::FromMilliseconds(-100L));
   sasl_client.set_deadline(deadline);
   Status s = sasl_client.Negotiate();
@@ -194,7 +194,7 @@ static void RunTimeoutNegotiationServer(Socket* sock) {
   SaslServer sasl_server(kSaslAppName, sock->GetFd());
   CHECK_OK(sasl_server.Init(kSaslAppName));
   CHECK_OK(sasl_server.EnableAnonymous());
-  MonoTime deadline = MonoTime::Now(MonoTime::FINE);
+  MonoTime deadline = MonoTime::Now();
   deadline.AddDelta(MonoDelta::FromMilliseconds(-100L));
   sasl_server.set_deadline(deadline);
   Status s = sasl_server.Negotiate();

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/server/hybrid_clock-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/hybrid_clock-test.cc b/src/kudu/server/hybrid_clock-test.cc
index 2444360..6a351c3 100644
--- a/src/kudu/server/hybrid_clock-test.cc
+++ b/src/kudu/server/hybrid_clock-test.cc
@@ -156,7 +156,7 @@ TEST_F(HybridClockTest, TestUpdate_LogicalValueIncreasesByAmount) {
 // Test that the incoming event is in the past, i.e. less than now - max_error
 TEST_F(HybridClockTest, TestWaitUntilAfter_TestCase1) {
   MonoTime no_deadline;
-  MonoTime before = MonoTime::Now(MonoTime::FINE);
+  MonoTime before = MonoTime::Now();
 
   Timestamp past_ts;
   uint64_t max_error;
@@ -171,7 +171,7 @@ TEST_F(HybridClockTest, TestWaitUntilAfter_TestCase1) {
 
   ASSERT_OK(s);
 
-  MonoTime after = MonoTime::Now(MonoTime::FINE);
+  MonoTime after = MonoTime::Now();
   MonoDelta delta = after.GetDeltaSince(before);
   // The delta should be close to 0, but it takes some time for the hybrid
   // logical clock to decide that it doesn't need to wait.
@@ -181,7 +181,7 @@ TEST_F(HybridClockTest, TestWaitUntilAfter_TestCase1) {
 // The normal case for transactions. Obtain a timestamp and then wait until
 // we're sure that tx_latest < now_earliest.
 TEST_F(HybridClockTest, TestWaitUntilAfter_TestCase2) {
-  MonoTime before = MonoTime::Now(MonoTime::FINE);
+  MonoTime before = MonoTime::Now();
 
   // we do no time adjustment, this event should fall right within the possible
   // error interval
@@ -213,7 +213,7 @@ TEST_F(HybridClockTest, TestWaitUntilAfter_TestCase2) {
     ASSERT_OK(clock_->WaitUntilAfter(wait_until, deadline));
   }
 
-  MonoTime after = MonoTime::Now(MonoTime::FINE);
+  MonoTime after = MonoTime::Now();
   MonoDelta delta = after.GetDeltaSince(before);
 
   // In the common case current_max_error >= past_max_error and we should have waited

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/server/hybrid_clock.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/hybrid_clock.cc b/src/kudu/server/hybrid_clock.cc
index cc3b611..1a5d75e 100644
--- a/src/kudu/server/hybrid_clock.cc
+++ b/src/kudu/server/hybrid_clock.cc
@@ -112,7 +112,7 @@ Status CheckDeadlineNotWithinMicros(const MonoTime& deadline, int64_t wait_for_u
     return Status::OK();
   }
   int64_t us_until_deadline = deadline.GetDeltaSince(
-      MonoTime::Now(MonoTime::FINE)).ToMicroseconds();
+      MonoTime::Now()).ToMicroseconds();
   if (us_until_deadline <= wait_for_usec) {
     return Status::TimedOut(Substitute(
         "specified time is $0us in the future, but deadline expires in $1us",

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/server/logical_clock-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/logical_clock-test.cc b/src/kudu/server/logical_clock-test.cc
index 0a4b52f..2635c2f 100644
--- a/src/kudu/server/logical_clock-test.cc
+++ b/src/kudu/server/logical_clock-test.cc
@@ -63,7 +63,7 @@ TEST_F(LogicalClockTest, TestUpdate_LogicalValueDoesNotIncrease) {
 
 TEST_F(LogicalClockTest, TestWaitUntilAfterIsUnavailable) {
   Status status = clock_->WaitUntilAfter(
-      Timestamp(10), MonoTime::Now(MonoTime::FINE));
+      Timestamp(10), MonoTime::Now());
   ASSERT_TRUE(status.IsServiceUnavailable());
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/server/pprof-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/pprof-path-handlers.cc b/src/kudu/server/pprof-path-handlers.cc
index ccac225..c1850ee 100644
--- a/src/kudu/server/pprof-path-handlers.cc
+++ b/src/kudu/server/pprof-path-handlers.cc
@@ -149,10 +149,10 @@ static void PprofContentionHandler(const Webserver::WebRequest& req, stringstrea
   *output << "sampling period = 1" << endl;
   *output << "cycles/second = " << base::CyclesPerSecond() << endl;
 
-  MonoTime end = MonoTime::Now(MonoTime::FINE);
+  MonoTime end = MonoTime::Now();
   end.AddDelta(MonoDelta::FromSeconds(seconds));
   StartSynchronizationProfiling();
-  while (MonoTime::Now(MonoTime::FINE).ComesBefore(end)) {
+  while (MonoTime::Now().ComesBefore(end)) {
     SleepFor(MonoDelta::FromMilliseconds(500));
     FlushSynchronizationProfile(output, &discarded_samples);
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/server/server_base.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/server_base.cc b/src/kudu/server/server_base.cc
index b8ea4f9..19c9f6a 100644
--- a/src/kudu/server/server_base.cc
+++ b/src/kudu/server/server_base.cc
@@ -257,9 +257,9 @@ void ServerBase::MetricsLoggingThread() {
   const MonoDelta kWaitBetweenFailures = MonoDelta::FromSeconds(60);
 
 
-  MonoTime next_log = MonoTime::Now(MonoTime::FINE);
+  MonoTime next_log = MonoTime::Now();
   while (!stop_metrics_logging_latch_.WaitUntil(next_log)) {
-    next_log = MonoTime::Now(MonoTime::FINE);
+    next_log = MonoTime::Now();
     next_log.AddDelta(MonoDelta::FromMilliseconds(options_.metrics_log_interval_ms));
 
     std::stringstream buf;

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/server/webui_util.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/webui_util.cc b/src/kudu/server/webui_util.cc
index 82ec833..ebdc353 100644
--- a/src/kudu/server/webui_util.cc
+++ b/src/kudu/server/webui_util.cc
@@ -170,7 +170,7 @@ void HtmlOutputTaskList(const std::vector<scoped_refptr<MonitoredTask> >& tasks,
       running_secs = task->completion_timestamp().GetDeltaSince(
         task->start_timestamp()).ToSeconds();
     } else if (task->start_timestamp().Initialized()) {
-      running_secs = MonoTime::Now(MonoTime::FINE).GetDeltaSince(
+      running_secs = MonoTime::Now().GetDeltaSince(
         task->start_timestamp()).ToSeconds();
     }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tablet/compaction-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/compaction-test.cc b/src/kudu/tablet/compaction-test.cc
index 695040f..45bb343 100644
--- a/src/kudu/tablet/compaction-test.cc
+++ b/src/kudu/tablet/compaction-test.cc
@@ -749,7 +749,7 @@ TEST_F(TestCompaction, TestCompactionFreesDiskSpace) {
 
   // Block deletion may happen asynchronously, so let's loop for a bit until
   // the space becomes free.
-  MonoTime deadline = MonoTime::Now(MonoTime::FINE);
+  MonoTime deadline = MonoTime::Now();
   deadline.AddDelta(MonoDelta::FromSeconds(30));
   while (true) {
     uint64_t bytes_after;
@@ -759,7 +759,7 @@ TEST_F(TestCompaction, TestCompactionFreesDiskSpace) {
                             bytes_before, bytes_after);
     if (bytes_after < bytes_before) {
       break;
-    } else if (deadline.ComesBefore(MonoTime::Now(MonoTime::FINE))) {
+    } else if (deadline.ComesBefore(MonoTime::Now())) {
       FAIL() << "Timed out waiting for compaction to reduce data block disk "
              << "space usage";
     }

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tablet/mvcc-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/mvcc-test.cc b/src/kudu/tablet/mvcc-test.cc
index 7e166c5..48782f0 100644
--- a/src/kudu/tablet/mvcc-test.cc
+++ b/src/kudu/tablet/mvcc-test.cc
@@ -607,7 +607,7 @@ TEST_F(MvccTest, TestWaitUntilCleanDeadline) {
 
   // Wait until the 'tx1' timestamp is clean -- this won't happen because the
   // transaction isn't committed yet.
-  MonoTime deadline = MonoTime::Now(MonoTime::FINE);
+  MonoTime deadline = MonoTime::Now();
   deadline.AddDelta(MonoDelta::FromMilliseconds(10));
   MvccSnapshot snap;
   Status s = mgr.WaitForCleanSnapshotAtTimestamp(tx1, &snap, deadline);

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tablet/tablet.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet.cc b/src/kudu/tablet/tablet.cc
index 383e739..387d6f5 100644
--- a/src/kudu/tablet/tablet.cc
+++ b/src/kudu/tablet/tablet.cc
@@ -188,7 +188,7 @@ Tablet::Tablet(const scoped_refptr<TabletMetadata>& metadata,
   }
 
   if (FLAGS_tablet_throttler_rpc_per_sec > 0 || FLAGS_tablet_throttler_bytes_per_sec > 0) {
-    throttler_.reset(new Throttler(MonoTime::Now(MonoTime::FINE),
+    throttler_.reset(new Throttler(MonoTime::Now(),
                                    FLAGS_tablet_throttler_rpc_per_sec,
                                    FLAGS_tablet_throttler_bytes_per_sec,
                                    FLAGS_tablet_throttler_burst_factor));
@@ -896,7 +896,7 @@ bool Tablet::ShouldThrottleAllow(int64_t bytes) {
   if (!throttler_) {
     return true;
   }
-  return throttler_->Take(MonoTime::Now(MonoTime::FINE), 1, bytes);
+  return throttler_->Take(MonoTime::Now(), 1, bytes);
 }
 
 ////////////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tablet/tablet_mm_ops-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_mm_ops-test.cc b/src/kudu/tablet/tablet_mm_ops-test.cc
index 421f182..5f9514a 100644
--- a/src/kudu/tablet/tablet_mm_ops-test.cc
+++ b/src/kudu/tablet/tablet_mm_ops-test.cc
@@ -29,7 +29,7 @@ class KuduTabletMmOpsTest : public TabletTestBase<IntKeyTestSetup<INT64>> {
 
   KuduTabletMmOpsTest()
   : Superclass(),
-    next_time_(MonoTime::Now(MonoTime::FINE)) {
+    next_time_(MonoTime::Now()) {
   }
 
   virtual void SetUp() OVERRIDE {

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tablet/tablet_peer.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/tablet_peer.cc b/src/kudu/tablet/tablet_peer.cc
index c8e3646..cb5cd0d 100644
--- a/src/kudu/tablet/tablet_peer.cc
+++ b/src/kudu/tablet/tablet_peer.cc
@@ -289,7 +289,7 @@ Status TabletPeer::CheckRunning() const {
 }
 
 Status TabletPeer::WaitUntilConsensusRunning(const MonoDelta& timeout) {
-  MonoTime start(MonoTime::Now(MonoTime::FINE));
+  MonoTime start(MonoTime::Now());
 
   int backoff_exp = 0;
   const int kMaxBackoffExp = 8;
@@ -311,7 +311,7 @@ Status TabletPeer::WaitUntilConsensusRunning(const MonoDelta& timeout) {
     if (cached_state == RUNNING && has_consensus && consensus_->IsRunning()) {
       break;
     }
-    MonoTime now(MonoTime::Now(MonoTime::FINE));
+    MonoTime now(MonoTime::Now());
     MonoDelta elapsed(now.GetDeltaSince(start));
     if (elapsed.MoreThan(timeout)) {
       return Status::TimedOut(Substitute("Consensus is not running after waiting for $0. State; $1",
@@ -418,7 +418,7 @@ void TabletPeer::GetInFlightTransactions(Transaction::TraceType trace_type,
       }
       status_pb.set_description(driver->ToString());
       int64_t running_for_micros =
-          MonoTime::Now(MonoTime::FINE).GetDeltaSince(driver->start_time()).ToMicroseconds();
+          MonoTime::Now().GetDeltaSince(driver->start_time()).ToMicroseconds();
       status_pb.set_running_for_micros(running_for_micros);
       if (trace_type == Transaction::TRACE_TXNS) {
         status_pb.set_trace_buffer(driver->trace()->DumpToString());

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tablet/transactions/transaction_driver.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/transactions/transaction_driver.cc b/src/kudu/tablet/transactions/transaction_driver.cc
index 1b90564..974969d 100644
--- a/src/kudu/tablet/transactions/transaction_driver.cc
+++ b/src/kudu/tablet/transactions/transaction_driver.cc
@@ -94,7 +94,7 @@ TransactionDriver::TransactionDriver(TransactionTracker *txn_tracker,
       apply_pool_(apply_pool),
       order_verifier_(order_verifier),
       trace_(new Trace()),
-      start_time_(MonoTime::Now(MonoTime::FINE)),
+      start_time_(MonoTime::Now()),
       replication_state_(NOT_REPLICATING),
       prepare_state_(NOT_PREPARED) {
   if (Trace::CurrentTrace()) {
@@ -111,7 +111,7 @@ Status TransactionDriver::Init(gscoped_ptr<Transaction> transaction,
     op_id_copy_ = transaction_->state()->op_id();
     DCHECK(op_id_copy_.IsInitialized());
     replication_state_ = REPLICATING;
-    replication_start_time_ = MonoTime::Now(MonoTime::FINE);
+    replication_start_time_ = MonoTime::Now();
     if (state()->are_results_tracked()) {
       // If this is a follower transaction, make sure to set the transaction completion callback
       // before the transaction has a chance to fail.
@@ -286,7 +286,7 @@ Status TransactionDriver::PrepareAndStart() {
       {
         std::lock_guard<simple_spinlock> lock(lock_);
         replication_state_ = REPLICATING;
-        replication_start_time_ = MonoTime::Now(MonoTime::FINE);
+        replication_start_time_ = MonoTime::Now();
       }
 
       Status s = consensus_->Replicate(mutable_state()->consensus_round());
@@ -356,7 +356,7 @@ void TransactionDriver::HandleFailure(const Status& s) {
 }
 
 void TransactionDriver::ReplicationFinished(const Status& status) {
-  MonoTime replication_finished_time = MonoTime::Now(MonoTime::FINE);
+  MonoTime replication_finished_time = MonoTime::Now();
 
   ADOPT_TRACE(trace());
   {
@@ -502,7 +502,7 @@ void TransactionDriver::SetResponseTimestamp(TransactionState* transaction_state
 }
 
 Status TransactionDriver::CommitWait() {
-  MonoTime before = MonoTime::Now(MonoTime::FINE);
+  MonoTime before = MonoTime::Now();
   DCHECK(mutable_state()->external_consistency_mode() == COMMIT_WAIT);
   // TODO: we could plumb the RPC deadline in here, and not bother commit-waiting
   // if the deadline is already expired.
@@ -510,7 +510,7 @@ Status TransactionDriver::CommitWait() {
       mutable_state()->tablet_peer()->clock()->WaitUntilAfter(mutable_state()->timestamp(),
                                                               MonoTime::Max()));
   mutable_state()->mutable_metrics()->commit_wait_duration_usec =
-      MonoTime::Now(MonoTime::FINE).GetDeltaSince(before).ToMicroseconds();
+      MonoTime::Now().GetDeltaSince(before).ToMicroseconds();
   return Status::OK();
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tablet/transactions/transaction_tracker.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/transactions/transaction_tracker.cc b/src/kudu/tablet/transactions/transaction_tracker.cc
index 17887ec..4e0033e 100644
--- a/src/kudu/tablet/transactions/transaction_tracker.cc
+++ b/src/kudu/tablet/transactions/transaction_tracker.cc
@@ -204,7 +204,7 @@ Status TransactionTracker::WaitForAllToFinish(const MonoDelta& timeout) const {
   const int complain_ms = 1000;
   int wait_time = 250;
   int num_complaints = 0;
-  MonoTime start_time = MonoTime::Now(MonoTime::FINE);
+  MonoTime start_time = MonoTime::Now();
   while (1) {
     vector<scoped_refptr<TransactionDriver> > txns;
     GetPendingTransactions(&txns);
@@ -213,7 +213,7 @@ Status TransactionTracker::WaitForAllToFinish(const MonoDelta& timeout) const {
       break;
     }
 
-    MonoDelta diff = MonoTime::Now(MonoTime::FINE).GetDeltaSince(start_time);
+    MonoDelta diff = MonoTime::Now().GetDeltaSince(start_time);
     if (diff.MoreThan(timeout)) {
       return Status::TimedOut(Substitute("Timed out waiting for all transactions to finish. "
                                          "$0 transactions pending. Waited for $1",

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tablet/transactions/write_transaction.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tablet/transactions/write_transaction.cc b/src/kudu/tablet/transactions/write_transaction.cc
index 6b4c0c6..a36bc6c 100644
--- a/src/kudu/tablet/transactions/write_transaction.cc
+++ b/src/kudu/tablet/transactions/write_transaction.cc
@@ -58,7 +58,7 @@ using strings::Substitute;
 WriteTransaction::WriteTransaction(unique_ptr<WriteTransactionState> state, DriverType type)
   : Transaction(state.get(), type, Transaction::WRITE_TXN),
   state_(std::move(state)) {
-  start_time_ = MonoTime::Now(MonoTime::FINE);
+  start_time_ = MonoTime::Now();
 }
 
 void WriteTransaction::NewReplicateMsg(gscoped_ptr<ReplicateMsg>* replicate_msg) {
@@ -177,7 +177,7 @@ void WriteTransaction::Finish(TransactionResult result) {
         metrics->commit_wait_duration->Increment(state_->metrics().commit_wait_duration_usec);
       }
       uint64_t op_duration_usec =
-          MonoTime::Now(MonoTime::FINE).GetDeltaSince(start_time_).ToMicroseconds();
+          MonoTime::Now().GetDeltaSince(start_time_).ToMicroseconds();
       switch (state()->external_consistency_mode()) {
         case CLIENT_PROPAGATED:
           metrics->write_op_duration_client_propagated_consistency->Increment(op_duration_usec);
@@ -193,7 +193,7 @@ void WriteTransaction::Finish(TransactionResult result) {
 }
 
 string WriteTransaction::ToString() const {
-  MonoTime now(MonoTime::Now(MonoTime::FINE));
+  MonoTime now(MonoTime::Now());
   MonoDelta d = now.GetDeltaSince(start_time_);
   WallTime abs_time = WallTime_Now() - d.ToSeconds();
   string abs_time_formatted;

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tools/ksck.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck.cc b/src/kudu/tools/ksck.cc
index 7d008eb..20e28af 100644
--- a/src/kudu/tools/ksck.cc
+++ b/src/kudu/tools/ksck.cc
@@ -277,20 +277,20 @@ class ChecksumResultReporter : public RefCountedThreadSafe<ChecksumResultReporte
   // Returns false if the timeout expired before all responses came in.
   // Otherwise, returns true.
   bool WaitFor(const MonoDelta& timeout) const {
-    MonoTime start = MonoTime::Now(MonoTime::FINE);
+    MonoTime start = MonoTime::Now();
 
     MonoTime deadline = start;
     deadline.AddDelta(timeout);
 
     bool done = false;
     while (!done) {
-      MonoTime now = MonoTime::Now(MonoTime::FINE);
+      MonoTime now = MonoTime::Now();
       int rem_ms = deadline.GetDeltaSince(now).ToMilliseconds();
       if (rem_ms <= 0) return false;
 
       done = responses_.WaitFor(MonoDelta::FromMilliseconds(std::min(rem_ms, 5000)));
       string status = done ? "finished in " : "running for ";
-      int run_time_sec = MonoTime::Now(MonoTime::FINE).GetDeltaSince(start).ToSeconds();
+      int run_time_sec = MonoTime::Now().GetDeltaSince(start).ToSeconds();
       Info() << "Checksum " << status << run_time_sec << "s: "
              << responses_.count() << "/" << expected_count_ << " replicas remaining ("
              << HumanReadableNumBytes::ToString(disk_bytes_summed_.Load()) << " from disk, "

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tools/ksck_remote-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tools/ksck_remote-test.cc b/src/kudu/tools/ksck_remote-test.cc
index 1528930..5f87c15 100644
--- a/src/kudu/tools/ksck_remote-test.cc
+++ b/src/kudu/tools/ksck_remote-test.cc
@@ -207,10 +207,10 @@ TEST_F(RemoteKsckTest, TestTabletServersOk) {
 }
 
 TEST_F(RemoteKsckTest, TestTableConsistency) {
-  MonoTime deadline = MonoTime::Now(MonoTime::FINE);
+  MonoTime deadline = MonoTime::Now();
   deadline.AddDelta(MonoDelta::FromSeconds(30));
   Status s;
-  while (MonoTime::Now(MonoTime::FINE).ComesBefore(deadline)) {
+  while (MonoTime::Now().ComesBefore(deadline)) {
     ASSERT_OK(ksck_->CheckMasterRunning());
     ASSERT_OK(ksck_->FetchTableAndTabletInfo());
     ASSERT_OK(ksck_->FetchInfoFromTabletServers());
@@ -228,10 +228,10 @@ TEST_F(RemoteKsckTest, TestChecksum) {
   LOG(INFO) << "Generating row writes...";
   ASSERT_OK(GenerateRowWrites(num_writes));
 
-  MonoTime deadline = MonoTime::Now(MonoTime::FINE);
+  MonoTime deadline = MonoTime::Now();
   deadline.AddDelta(MonoDelta::FromSeconds(30));
   Status s;
-  while (MonoTime::Now(MonoTime::FINE).ComesBefore(deadline)) {
+  while (MonoTime::Now().ComesBefore(deadline)) {
     ASSERT_OK(ksck_->FetchTableAndTabletInfo());
 
     err_stream_.str("");
@@ -274,7 +274,7 @@ TEST_F(RemoteKsckTest, TestChecksumSnapshot) {
   CHECK(started_writing.WaitFor(MonoDelta::FromSeconds(30)));
 
   uint64_t ts = client_->GetLatestObservedTimestamp();
-  MonoTime start(MonoTime::Now(MonoTime::FINE));
+  MonoTime start(MonoTime::Now());
   MonoTime deadline = start;
   deadline.AddDelta(MonoDelta::FromSeconds(30));
   Status s;
@@ -284,13 +284,13 @@ TEST_F(RemoteKsckTest, TestChecksumSnapshot) {
     ASSERT_OK(ksck_->FetchTableAndTabletInfo());
     Status s = ksck_->ChecksumData(ChecksumOptions(MonoDelta::FromSeconds(10), 16, true, ts));
     if (s.ok()) break;
-    if (deadline.ComesBefore(MonoTime::Now(MonoTime::FINE))) break;
+    if (deadline.ComesBefore(MonoTime::Now())) break;
     SleepFor(MonoDelta::FromMilliseconds(10));
   }
   if (!s.ok()) {
     LOG(WARNING) << Substitute("Timed out after $0 waiting for ksck to become consistent on TS $1. "
                                "Status: $2",
-                               MonoTime::Now(MonoTime::FINE).GetDeltaSince(start).ToString(),
+                               MonoTime::Now().GetDeltaSince(start).ToString(),
                                ts, s.ToString());
     EXPECT_OK(s); // To avoid ASAN complaints due to thread reading the CountDownLatch.
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tserver/heartbeater.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/heartbeater.cc b/src/kudu/tserver/heartbeater.cc
index c0a1c85..19027bb 100644
--- a/src/kudu/tserver/heartbeater.cc
+++ b/src/kudu/tserver/heartbeater.cc
@@ -424,7 +424,7 @@ void Heartbeater::Thread::RunThread() {
   last_hb_response_.set_needs_full_tablet_report(true);
 
   while (true) {
-    MonoTime next_heartbeat = MonoTime::Now(MonoTime::FINE);
+    MonoTime next_heartbeat = MonoTime::Now();
     next_heartbeat.AddDelta(MonoDelta::FromMilliseconds(GetMillisUntilNextHeartbeat()));
 
     // Wait for either the heartbeat interval to elapse, or for an "ASAP" heartbeat,
@@ -432,7 +432,7 @@ void Heartbeater::Thread::RunThread() {
     {
       MutexLock l(mutex_);
       while (true) {
-        MonoDelta remaining = next_heartbeat.GetDeltaSince(MonoTime::Now(MonoTime::FINE));
+        MonoDelta remaining = next_heartbeat.GetDeltaSince(MonoTime::Now());
         if (remaining.ToMilliseconds() <= 0 ||
             heartbeat_asap_ ||
             !should_run_) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tserver/scanner_metrics.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/scanner_metrics.cc b/src/kudu/tserver/scanner_metrics.cc
index f683955..2527b98 100644
--- a/src/kudu/tserver/scanner_metrics.cc
+++ b/src/kudu/tserver/scanner_metrics.cc
@@ -42,7 +42,7 @@ ScannerMetrics::ScannerMetrics(const scoped_refptr<MetricEntity>& metric_entity)
 
 void ScannerMetrics::SubmitScannerDuration(const MonoTime& time_started) {
   scanner_duration->Increment(
-      MonoTime::Now(MonoTime::COARSE).GetDeltaSince(time_started).ToMicroseconds());
+      MonoTime::Now().GetDeltaSince(time_started).ToMicroseconds());
 }
 
 } // namespace tserver

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tserver/scanners.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/scanners.cc b/src/kudu/tserver/scanners.cc
index 74e23d1..ab23b4c 100644
--- a/src/kudu/tserver/scanners.cc
+++ b/src/kudu/tserver/scanners.cc
@@ -158,7 +158,7 @@ void ScannerManager::RemoveExpiredScanners() {
     for (auto it = stripe->scanners_by_id_.begin(); it != stripe->scanners_by_id_.end();) {
       SharedScanner& scanner = it->second;
       MonoDelta time_live =
-          scanner->TimeSinceLastAccess(MonoTime::Now(MonoTime::COARSE));
+          scanner->TimeSinceLastAccess(MonoTime::Now());
       if (time_live.MoreThan(scanner_ttl)) {
         // TODO: once we have a metric for the number of scanners expired, make this a
         // VLOG(1).
@@ -183,7 +183,7 @@ Scanner::Scanner(string id, const scoped_refptr<TabletPeer>& tablet_peer,
       tablet_peer_(tablet_peer),
       requestor_string_(std::move(requestor_string)),
       call_seq_id_(0),
-      start_time_(MonoTime::Now(MonoTime::COARSE)),
+      start_time_(MonoTime::Now()),
       metrics_(metrics),
       arena_(1024, 1024 * 1024) {
   UpdateAccessTime();
@@ -197,7 +197,7 @@ Scanner::~Scanner() {
 
 void Scanner::UpdateAccessTime() {
   std::lock_guard<simple_spinlock> l(lock_);
-  last_access_time_ = MonoTime::Now(MonoTime::COARSE);
+  last_access_time_ = MonoTime::Now();
 }
 
 void Scanner::Init(gscoped_ptr<RowwiseIterator> iter,

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tserver/tablet_copy_service-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_copy_service-test.cc b/src/kudu/tserver/tablet_copy_service-test.cc
index b50c5fe..9eaaa6c 100644
--- a/src/kudu/tserver/tablet_copy_service-test.cc
+++ b/src/kudu/tserver/tablet_copy_service-test.cc
@@ -472,7 +472,7 @@ TEST_F(TabletCopyServiceTest, TestSessionTimeout) {
   string session_id;
   ASSERT_OK(DoBeginValidTabletCopySession(&session_id));
 
-  MonoTime start_time = MonoTime::Now(MonoTime::FINE);
+  MonoTime start_time = MonoTime::Now();
   CheckTabletCopySessionActiveResponsePB resp;
 
   do {
@@ -482,7 +482,7 @@ TEST_F(TabletCopyServiceTest, TestSessionTimeout) {
       break;
     }
     SleepFor(MonoDelta::FromMilliseconds(1)); // 1 ms
-  } while (MonoTime::Now(MonoTime::FINE).GetDeltaSince(start_time).ToSeconds() < 10);
+  } while (MonoTime::Now().GetDeltaSince(start_time).ToSeconds() < 10);
 
   ASSERT_FALSE(resp.session_is_active()) << "Tablet Copy session did not time out!";
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tserver/tablet_copy_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_copy_service.cc b/src/kudu/tserver/tablet_copy_service.cc
index 62168a7..caf35b5 100644
--- a/src/kudu/tserver/tablet_copy_service.cc
+++ b/src/kudu/tserver/tablet_copy_service.cc
@@ -310,7 +310,7 @@ Status TabletCopyServiceImpl::ValidateFetchRequestDataId(
 }
 
 void TabletCopyServiceImpl::ResetSessionExpirationUnlocked(const std::string& session_id) {
-  MonoTime expiration(MonoTime::Now(MonoTime::FINE));
+  MonoTime expiration(MonoTime::Now());
   expiration.AddDelta(MonoDelta::FromMilliseconds(FLAGS_tablet_copy_idle_timeout_ms));
   InsertOrUpdate(&session_expirations_, session_id, expiration);
 }
@@ -333,7 +333,7 @@ Status TabletCopyServiceImpl::DoEndTabletCopySessionUnlocked(
 void TabletCopyServiceImpl::EndExpiredSessions() {
   do {
     MutexLock l(sessions_lock_);
-    MonoTime now = MonoTime::Now(MonoTime::FINE);
+    MonoTime now = MonoTime::Now();
 
     vector<string> expired_session_ids;
     for (const MonoTimeMap::value_type& entry : session_expirations_) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tserver/tablet_server-stress-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server-stress-test.cc b/src/kudu/tserver/tablet_server-stress-test.cc
index 4d8430b..95af005 100644
--- a/src/kudu/tserver/tablet_server-stress-test.cc
+++ b/src/kudu/tserver/tablet_server-stress-test.cc
@@ -88,9 +88,9 @@ void TSStressTest::InserterThread(int thread_idx) {
   uint64_t max_rows = FLAGS_num_inserts_per_thread;
   int start_row = thread_idx * max_rows;
   for (int i = start_row; i < start_row + max_rows ; i++) {
-    MonoTime before = MonoTime::Now(MonoTime::FINE);
+    MonoTime before = MonoTime::Now();
     InsertTestRowsRemote(thread_idx, i, 1);
-    MonoTime after = MonoTime::Now(MonoTime::FINE);
+    MonoTime after = MonoTime::Now();
     MonoDelta delta = after.GetDeltaSince(before);
     histogram_->Increment(delta.ToMicroseconds());
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tserver/tablet_server-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_server-test.cc b/src/kudu/tserver/tablet_server-test.cc
index 05ca99b..99b801d 100644
--- a/src/kudu/tserver/tablet_server-test.cc
+++ b/src/kudu/tserver/tablet_server-test.cc
@@ -2027,17 +2027,17 @@ TEST_F(TabletServerTest, TestInsertLatencyMicroBenchmark) {
   uint64_t max_rows = AllowSlowTests() ?
       FLAGS_single_threaded_insert_latency_bench_insert_rows : 100;
 
-  MonoTime start = MonoTime::Now(MonoTime::FINE);
+  MonoTime start = MonoTime::Now();
 
   for (int i = warmup; i < warmup + max_rows; i++) {
-    MonoTime before = MonoTime::Now(MonoTime::FINE);
+    MonoTime before = MonoTime::Now();
     InsertTestRowsRemote(0, i, 1);
-    MonoTime after = MonoTime::Now(MonoTime::FINE);
+    MonoTime after = MonoTime::Now();
     MonoDelta delta = after.GetDeltaSince(before);
     histogram->Increment(delta.ToMicroseconds());
   }
 
-  MonoTime end = MonoTime::Now(MonoTime::FINE);
+  MonoTime end = MonoTime::Now();
   double throughput = ((max_rows - warmup) * 1.0) / end.GetDeltaSince(start).ToSeconds();
 
   // Generate the JSON.

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tserver/tablet_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_service.cc b/src/kudu/tserver/tablet_service.cc
index 586e82b..d5bc836 100644
--- a/src/kudu/tserver/tablet_service.cc
+++ b/src/kudu/tserver/tablet_service.cc
@@ -1590,7 +1590,7 @@ Status TabletServiceImpl::HandleContinueScanRequest(const ScanRequestPB* req,
   // TODO: in the future, use the client timeout to set a budget. For now,
   // just use a half second, which should be plenty to amortize call overhead.
   int budget_ms = 500;
-  MonoTime deadline = MonoTime::Now(MonoTime::COARSE);
+  MonoTime deadline = MonoTime::Now();
   deadline.AddDelta(MonoDelta::FromMilliseconds(budget_ms));
 
   int64_t rows_scanned = 0;
@@ -1622,7 +1622,7 @@ Status TabletServiceImpl::HandleContinueScanRequest(const ScanRequestPB* req,
     }
 
     // TODO: should check if RPC got cancelled, once we implement RPC cancellation.
-    MonoTime now = MonoTime::Now(MonoTime::COARSE);
+    MonoTime now = MonoTime::Now();
     if (PREDICT_FALSE(!now.ComesBefore(deadline))) {
       TRACE("Deadline expired - responding early");
       break;
@@ -1737,20 +1737,20 @@ Status TabletServiceImpl::HandleScanAtSnapshot(const NewScanRequestPB& scan_pb,
   // have time to send our response sent back before it times out.
   client_deadline.AddDelta(MonoDelta::FromMilliseconds(-10));
 
-  MonoTime deadline = MonoTime::Now(MonoTime::FINE);
+  MonoTime deadline = MonoTime::Now();
   deadline.AddDelta(MonoDelta::FromSeconds(5));
   if (client_deadline.ComesBefore(deadline)) {
     deadline = client_deadline;
   }
 
   TRACE("Waiting for operations in snapshot to commit");
-  MonoTime before = MonoTime::Now(MonoTime::FINE);
+  MonoTime before = MonoTime::Now();
   RETURN_NOT_OK_PREPEND(
       tablet->mvcc_manager()->WaitForCleanSnapshotAtTimestamp(
           tmp_snap_timestamp, &snap, deadline),
       "could not wait for desired snapshot timestamp to be consistent");
 
-  uint64_t duration_usec = MonoTime::Now(MonoTime::FINE).GetDeltaSince(before).ToMicroseconds();
+  uint64_t duration_usec = MonoTime::Now().GetDeltaSince(before).ToMicroseconds();
   tablet->metrics()->snapshot_read_inflight_wait_duration->Increment(duration_usec);
   TRACE("All operations in snapshot committed. Waited for $0 microseconds", duration_usec);
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tserver/ts_tablet_manager-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/ts_tablet_manager-test.cc b/src/kudu/tserver/ts_tablet_manager-test.cc
index 8641e0b..dfbb7f1 100644
--- a/src/kudu/tserver/ts_tablet_manager-test.cc
+++ b/src/kudu/tserver/ts_tablet_manager-test.cc
@@ -227,7 +227,7 @@ TEST_F(TsTabletManagerTest, TestTabletReports) {
   // initial configuration change, so there is also a window for tablet-1 to
   // have been marked dirty since the last report.
   MonoDelta timeout(MonoDelta::FromSeconds(10));
-  MonoTime start(MonoTime::Now(MonoTime::FINE));
+  MonoTime start(MonoTime::Now());
   report.Clear();
   while (true) {
     bool found_tablet_2 = false;
@@ -241,7 +241,7 @@ TEST_F(TsTabletManagerTest, TestTabletReports) {
       }
     }
     if (found_tablet_2) break;
-    MonoDelta elapsed(MonoTime::Now(MonoTime::FINE).GetDeltaSince(start));
+    MonoDelta elapsed(MonoTime::Now().GetDeltaSince(start));
     ASSERT_TRUE(elapsed.LessThan(timeout)) << "Waited too long for tablet-2 to be marked dirty: "
                                            << elapsed.ToString() << ". "
                                            << "Latest report: " << report.ShortDebugString();

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tserver/ts_tablet_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/ts_tablet_manager.cc b/src/kudu/tserver/ts_tablet_manager.cc
index a1fff30..02ddd95 100644
--- a/src/kudu/tserver/ts_tablet_manager.cc
+++ b/src/kudu/tserver/ts_tablet_manager.cc
@@ -657,7 +657,7 @@ void TSTabletManager::OpenTablet(const scoped_refptr<TabletMetadata>& meta,
     }
   }
 
-  MonoTime start(MonoTime::Now(MonoTime::FINE));
+  MonoTime start(MonoTime::Now());
   LOG_TIMING_PREFIX(INFO, LogPrefix(tablet_id), "starting tablet") {
     TRACE("Initializing tablet peer");
     s =  tablet_peer->Init(tablet,
@@ -686,7 +686,7 @@ void TSTabletManager::OpenTablet(const scoped_refptr<TabletMetadata>& meta,
     tablet_peer->RegisterMaintenanceOps(server_->maintenance_manager());
   }
 
-  int elapsed_ms = MonoTime::Now(MonoTime::FINE).GetDeltaSince(start).ToMilliseconds();
+  int elapsed_ms = MonoTime::Now().GetDeltaSince(start).ToMilliseconds();
   if (elapsed_ms > FLAGS_tablet_start_warn_threshold_ms) {
     LOG(WARNING) << LogPrefix(tablet_id) << "Tablet startup took " << elapsed_ms << "ms";
     if (Trace::CurrentTrace()) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/tserver/tserver-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tserver-path-handlers.cc b/src/kudu/tserver/tserver-path-handlers.cc
index 19c19a3..18e95a5 100644
--- a/src/kudu/tserver/tserver-path-handlers.cc
+++ b/src/kudu/tserver/tserver-path-handlers.cc
@@ -417,9 +417,9 @@ void TabletServerPathHandlers::HandleScansPage(const Webserver::WebRequest& req,
 string TabletServerPathHandlers::ScannerToHtml(const Scanner& scanner) const {
   std::stringstream html;
   uint64_t time_in_flight_us =
-      MonoTime::Now(MonoTime::COARSE).GetDeltaSince(scanner.start_time()).ToMicroseconds();
+      MonoTime::Now().GetDeltaSince(scanner.start_time()).ToMicroseconds();
   uint64_t time_since_last_access_us =
-      scanner.TimeSinceLastAccess(MonoTime::Now(MonoTime::COARSE)).ToMicroseconds();
+      scanner.TimeSinceLastAccess(MonoTime::Now()).ToMicroseconds();
 
   html << Substitute("<tr><td>$0</td><td>$1</td><td>$2 us.</td><td>$3 us.</td><td>$4</td>",
                      EscapeForHtmlToString(scanner.tablet_id()), // $0

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/countdown_latch.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/countdown_latch.h b/src/kudu/util/countdown_latch.h
index c7d2693..1816f4c 100644
--- a/src/kudu/util/countdown_latch.h
+++ b/src/kudu/util/countdown_latch.h
@@ -79,7 +79,7 @@ class CountDownLatch {
   // Returns true if the count became zero, false otherwise.
   bool WaitUntil(const MonoTime& when) const {
     ThreadRestrictions::AssertWaitAllowed();
-    MonoDelta relative = when.GetDeltaSince(MonoTime::Now(MonoTime::FINE));
+    MonoDelta relative = when.GetDeltaSince(MonoTime::Now());
     return WaitFor(relative);
   }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/debug/trace_event_synthetic_delay.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/debug/trace_event_synthetic_delay.cc b/src/kudu/util/debug/trace_event_synthetic_delay.cc
index 4669234..ecbe383 100644
--- a/src/kudu/util/debug/trace_event_synthetic_delay.cc
+++ b/src/kudu/util/debug/trace_event_synthetic_delay.cc
@@ -183,7 +183,7 @@ TraceEventSyntheticDelay* TraceEventSyntheticDelayRegistry::GetOrCreateDelay(
 }
 
 MonoTime TraceEventSyntheticDelayRegistry::Now() {
-  return MonoTime::Now(MonoTime::FINE);
+  return MonoTime::Now();
 }
 
 void TraceEventSyntheticDelayRegistry::ResetAllDelays() {

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/failure_detector-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/failure_detector-test.cc b/src/kudu/util/failure_detector-test.cc
index 03a5789..306d81a 100644
--- a/src/kudu/util/failure_detector-test.cc
+++ b/src/kudu/util/failure_detector-test.cc
@@ -79,7 +79,7 @@ TEST_F(FailureDetectorTest, TestDetectsFailure) {
   monitor_->MonitorFailureDetector(kTestTabletName, detector);
   ASSERT_FALSE(detector->IsTracking(kNodeName));
   ASSERT_OK(detector->Track(kNodeName,
-                            MonoTime::Now(MonoTime::FINE),
+                            MonoTime::Now(),
                             Bind(&FailureDetectorTest::FailureFunction, Unretained(this))));
   ASSERT_TRUE(detector->IsTracking(kNodeName));
 
@@ -88,7 +88,7 @@ TEST_F(FailureDetectorTest, TestDetectsFailure) {
 
   for (int i = 0; i < kNumPeriodsToWait * kUpdatesPerPeriod; i++) {
     // Report in (heartbeat) to the detector.
-    ASSERT_OK(detector->MessageFrom(kNodeName, MonoTime::Now(MonoTime::FINE)));
+    ASSERT_OK(detector->MessageFrom(kNodeName, MonoTime::Now()));
 
     // We sleep for a fraction of heartbeat period, to minimize test flakiness.
     SleepFor(MonoDelta::FromMilliseconds(kExpectedHeartbeatPeriodMillis / kUpdatesPerPeriod));

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/failure_detector.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/failure_detector.cc b/src/kudu/util/failure_detector.cc
index c5c51a7..696abc2 100644
--- a/src/kudu/util/failure_detector.cc
+++ b/src/kudu/util/failure_detector.cc
@@ -204,7 +204,7 @@ void RandomizedFailureMonitor::RunThread() {
       fds_copy = fds_;
     }
 
-    MonoTime now = MonoTime::Now(MonoTime::FINE);
+    MonoTime now = MonoTime::Now();
     for (const FDMap::value_type& entry : fds_copy) {
       entry.second->CheckForFailures(now);
     }

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/maintenance_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/maintenance_manager.cc b/src/kudu/util/maintenance_manager.cc
index 54c4dc6..3ff8fe3 100644
--- a/src/kudu/util/maintenance_manager.cc
+++ b/src/kudu/util/maintenance_manager.cc
@@ -348,7 +348,7 @@ MaintenanceOp* MaintenanceManager::FindBestOp() {
 }
 
 void MaintenanceManager::LaunchOp(MaintenanceOp* op) {
-  MonoTime start_time(MonoTime::Now(MonoTime::FINE));
+  MonoTime start_time(MonoTime::Now());
   op->RunningGauge()->Increment();
   LOG_TIMING(INFO, Substitute("running $0", op->name())) {
     TRACE_EVENT1("maintenance", "MaintenanceManager::LaunchOp",
@@ -356,7 +356,7 @@ void MaintenanceManager::LaunchOp(MaintenanceOp* op) {
     op->Perform();
   }
   op->RunningGauge()->Decrement();
-  MonoTime end_time(MonoTime::Now(MonoTime::FINE));
+  MonoTime end_time(MonoTime::Now());
   MonoDelta delta(end_time.GetDeltaSince(start_time));
   std::lock_guard<Mutex> guard(lock_);
 
@@ -406,7 +406,7 @@ void MaintenanceManager::GetMaintenanceManagerStatusDump(MaintenanceManagerStatu
       completed_pb->set_name(completed_op.name);
       completed_pb->set_duration_millis(completed_op.duration.ToMilliseconds());
 
-      MonoDelta delta(MonoTime::Now(MonoTime::FINE).GetDeltaSince(completed_op.start_mono_time));
+      MonoDelta delta(MonoTime::Now().GetDeltaSince(completed_op.start_mono_time));
       completed_pb->set_secs_since_start(delta.ToSeconds());
     }
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/maintenance_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/maintenance_manager.h b/src/kudu/util/maintenance_manager.h
index ef3229e..c55d62b 100644
--- a/src/kudu/util/maintenance_manager.h
+++ b/src/kudu/util/maintenance_manager.h
@@ -101,7 +101,7 @@ class MaintenanceOpStats {
  private:
   void UpdateLastModified() {
     valid_ = true;
-    last_modified_ = MonoTime::Now(MonoTime::FINE);
+    last_modified_ = MonoTime::Now();
   }
 
   // True if these stats are valid.

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/metrics.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/metrics.cc b/src/kudu/util/metrics.cc
index 31e2d50..27766ac 100644
--- a/src/kudu/util/metrics.cc
+++ b/src/kudu/util/metrics.cc
@@ -252,7 +252,7 @@ Status MetricEntity::WriteAsJson(JsonWriter* writer,
 }
 
 void MetricEntity::RetireOldMetrics() {
-  MonoTime now(MonoTime::Now(MonoTime::FINE));
+  MonoTime now(MonoTime::Now());
 
   std::lock_guard<simple_spinlock> l(lock_);
   for (auto it = metric_map_.begin(); it != metric_map_.end();) {
@@ -669,13 +669,13 @@ double Histogram::MeanValueForTests() const {
 ScopedLatencyMetric::ScopedLatencyMetric(Histogram* latency_hist)
   : latency_hist_(latency_hist) {
   if (latency_hist_) {
-    time_started_ = MonoTime::Now(MonoTime::FINE);
+    time_started_ = MonoTime::Now();
   }
 }
 
 ScopedLatencyMetric::~ScopedLatencyMetric() {
   if (latency_hist_ != nullptr) {
-    MonoTime time_now = MonoTime::Now(MonoTime::FINE);
+    MonoTime time_now = MonoTime::Now();
     latency_hist_->Increment(time_now.GetDeltaSince(time_started_).ToMicroseconds());
   }
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/monotime-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/monotime-test.cc b/src/kudu/util/monotime-test.cc
index 96d7277..2852768 100644
--- a/src/kudu/util/monotime-test.cc
+++ b/src/kudu/util/monotime-test.cc
@@ -29,11 +29,11 @@ namespace kudu {
 
 TEST(TestMonoTime, TestMonotonicity) {
   alarm(360);
-  MonoTime prev(MonoTime::Now(MonoTime::FINE));
+  MonoTime prev(MonoTime::Now());
   MonoTime next;
 
   do {
-    next = MonoTime::Now(MonoTime::FINE);
+    next = MonoTime::Now();
     //LOG(INFO) << " next = " << next.ToString();
   } while (!prev.ComesBefore(next));
   ASSERT_FALSE(next.ComesBefore(prev));
@@ -41,7 +41,7 @@ TEST(TestMonoTime, TestMonotonicity) {
 }
 
 TEST(TestMonoTime, TestComparison) {
-  MonoTime now(MonoTime::Now(MonoTime::COARSE));
+  MonoTime now(MonoTime::Now());
   MonoTime future(now);
   future.AddDelta(MonoDelta::FromNanoseconds(1L));
 
@@ -121,11 +121,11 @@ TEST(TestMonoTime, TestTimeSpec) {
 TEST(TestMonoTime, TestDeltas) {
   alarm(360);
   const MonoDelta max_delta(MonoDelta::FromSeconds(0.1));
-  MonoTime prev(MonoTime::Now(MonoTime::FINE));
+  MonoTime prev(MonoTime::Now());
   MonoTime next;
   MonoDelta cur_delta;
   do {
-    next = MonoTime::Now(MonoTime::FINE);
+    next = MonoTime::Now();
     cur_delta = next.GetDeltaSince(prev);
   } while (cur_delta.LessThan(max_delta));
   alarm(0);
@@ -144,28 +144,27 @@ TEST(TestMonoTime, TestDeltaConversions) {
   ASSERT_EQ(500, nano.nano_delta_);
 }
 
-static void DoTestMonoTimePerf(MonoTime::Granularity granularity) {
+static void DoTestMonoTimePerf() {
   const MonoDelta max_delta(MonoDelta::FromMilliseconds(500));
   uint64_t num_calls = 0;
-  MonoTime prev(MonoTime::Now(granularity));
+  MonoTime prev(MonoTime::Now());
   MonoTime next;
   MonoDelta cur_delta;
   do {
-    next = MonoTime::Now(granularity);
+    next = MonoTime::Now();
     cur_delta = next.GetDeltaSince(prev);
     num_calls++;
   } while (cur_delta.LessThan(max_delta));
-  LOG(INFO) << "DoTestMonoTimePerf(granularity="
-        << ((granularity == MonoTime::FINE) ? "FINE" : "COARSE")
-        << "): " << num_calls << " in "
+  LOG(INFO) << "DoTestMonoTimePerf():"
+        << num_calls << " in "
         << max_delta.ToString() << " seconds.";
 }
 
 TEST(TestMonoTime, TestSleepFor) {
-  MonoTime start = MonoTime::Now(MonoTime::FINE);
+  MonoTime start = MonoTime::Now();
   MonoDelta sleep = MonoDelta::FromMilliseconds(100);
   SleepFor(sleep);
-  MonoTime end = MonoTime::Now(MonoTime::FINE);
+  MonoTime end = MonoTime::Now();
   MonoDelta actualSleep = end.GetDeltaSince(start);
   ASSERT_GE(actualSleep.ToNanoseconds(), sleep.ToNanoseconds());
 }
@@ -178,23 +177,17 @@ TEST(TestMonoTime, TestSleepForOverflow) {
 
   // This quantity (~4s sleep) overflows a 32-bit integer such that
   // the value becomes 0.
-  MonoTime start = MonoTime::Now(MonoTime::FINE);
+  MonoTime start = MonoTime::Now();
   MonoDelta sleep = MonoDelta::FromNanoseconds(1L << 32);
   SleepFor(sleep);
-  MonoTime end = MonoTime::Now(MonoTime::FINE);
+  MonoTime end = MonoTime::Now();
   MonoDelta actualSleep = end.GetDeltaSince(start);
   ASSERT_GE(actualSleep.ToNanoseconds(), sleep.ToNanoseconds());
 }
 
-TEST(TestMonoTimePerf, TestMonoTimePerfCoarse) {
+TEST(TestMonoTimePerf, TestMonoTimePerf) {
   alarm(360);
-  DoTestMonoTimePerf(MonoTime::COARSE);
-  alarm(0);
-}
-
-TEST(TestMonoTimePerf, TestMonoTimePerfFine) {
-  alarm(360);
-  DoTestMonoTimePerf(MonoTime::FINE);
+  DoTestMonoTimePerf();
   alarm(0);
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/monotime.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/monotime.cc b/src/kudu/util/monotime.cc
index 51c95e9..511dd15 100644
--- a/src/kudu/util/monotime.cc
+++ b/src/kudu/util/monotime.cc
@@ -163,20 +163,12 @@ void MonoDelta::ToTimeSpec(struct timespec *ts) const {
 /// MonoTime
 ///
 
-MonoTime MonoTime::Now(enum Granularity granularity) {
+MonoTime MonoTime::Now() {
 #if defined(__APPLE__)
   return MonoTime(walltime_internal::GetMonoTimeNanos());
 # else
   struct timespec ts;
-  clockid_t clock;
-
-// Older systems do not support CLOCK_MONOTONIC_COARSE
-#ifdef CLOCK_MONOTONIC_COARSE
-  clock = (granularity == COARSE) ? CLOCK_MONOTONIC_COARSE : CLOCK_MONOTONIC;
-#else
-  clock = CLOCK_MONOTONIC;
-#endif
-  PCHECK(clock_gettime(clock, &ts) == 0);
+  PCHECK(clock_gettime(CLOCK_MONOTONIC, &ts) == 0);
   return MonoTime(ts);
 #endif // defined(__APPLE__)
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/monotime.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/monotime.h b/src/kudu/util/monotime.h
index 4e27d18..8aa99a8 100644
--- a/src/kudu/util/monotime.h
+++ b/src/kudu/util/monotime.h
@@ -144,16 +144,6 @@ class KUDU_EXPORT MonoDelta {
 /// clock, the monotime does not change.
 class KUDU_EXPORT MonoTime {
  public:
-  /// @brief The granularity of the time specification
-  ///
-  /// The coarse monotonic time is faster to retrieve, but "only"
-  /// accurate to within a millisecond or two. The speed difference will
-  /// depend on your timer hardware.
-  enum Granularity {
-    COARSE,
-    FINE
-  };
-
   /// @name Conversion constants for ubiquitous time units.
   ///
   ///@{
@@ -166,10 +156,8 @@ class KUDU_EXPORT MonoTime {
 
   /// Get current time in MonoTime representation.
   ///
-  /// @param [in] granularity
-  ///   Granularity for the resulting time specification.
   /// @return Time specification for the moment of the method's invocation.
-  static MonoTime Now(enum Granularity granularity);
+  static MonoTime Now();
 
   /// @return MonoTime equal to farthest possible time into the future.
   static MonoTime Max();

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/net/socket.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/net/socket.cc b/src/kudu/util/net/socket.cc
index 7a6933b..150b7b2 100644
--- a/src/kudu/util/net/socket.cc
+++ b/src/kudu/util/net/socket.cc
@@ -434,7 +434,7 @@ Status Socket::BlockingWrite(const uint8_t *buf, size_t buflen, size_t *nwritten
   while (tot_written < buflen) {
     int32_t inc_num_written = 0;
     int32_t num_to_write = buflen - tot_written;
-    MonoDelta timeout = deadline.GetDeltaSince(MonoTime::Now(MonoTime::FINE));
+    MonoDelta timeout = deadline.GetDeltaSince(MonoTime::Now());
     if (PREDICT_FALSE(timeout.ToNanoseconds() <= 0)) {
       return Status::TimedOut("BlockingWrite timed out");
     }
@@ -505,7 +505,7 @@ Status Socket::BlockingRecv(uint8_t *buf, size_t amt, size_t *nread, const MonoT
   while (tot_read < amt) {
     int32_t inc_num_read = 0;
     int32_t num_to_read = amt - tot_read;
-    MonoDelta timeout = deadline.GetDeltaSince(MonoTime::Now(MonoTime::FINE));
+    MonoDelta timeout = deadline.GetDeltaSince(MonoTime::Now());
     if (PREDICT_FALSE(timeout.ToNanoseconds() <= 0)) {
       return Status::TimedOut("");
     }

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/striped64-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/striped64-test.cc b/src/kudu/util/striped64-test.cc
index d211a0a..f5dbdcf 100644
--- a/src/kudu/util/striped64-test.cc
+++ b/src/kudu/util/striped64-test.cc
@@ -117,13 +117,13 @@ class BasicAdder {
 };
 
 void RunMultiTest(int64_t num_operations, int64_t num_threads) {
-  MonoTime start = MonoTime::Now(MonoTime::FINE);
+  MonoTime start = MonoTime::Now();
   MultiThreadTest<BasicAdder> basicTest(num_operations, num_threads);
   basicTest.Run();
-  MonoTime end1 = MonoTime::Now(MonoTime::FINE);
+  MonoTime end1 = MonoTime::Now();
   MultiThreadTest<LongAdder> test(num_operations, num_threads);
   test.Run();
-  MonoTime end2 = MonoTime::Now(MonoTime::FINE);
+  MonoTime end2 = MonoTime::Now();
   MonoDelta basic = end1.GetDeltaSince(start);
   MonoDelta striped = end2.GetDeltaSince(end1);
   LOG(INFO) << "Basic counter took   " << basic.ToMilliseconds() << "ms.";

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/striped64.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/striped64.cc b/src/kudu/util/striped64.cc
index 7b566e7..d949735 100644
--- a/src/kudu/util/striped64.cc
+++ b/src/kudu/util/striped64.cc
@@ -32,7 +32,7 @@ namespace internal {
 //
 
 HashCode::HashCode() {
-  Random r(MonoTime::Now(MonoTime::FINE).GetDeltaSince(MonoTime::Min()).ToNanoseconds());
+  Random r(MonoTime::Now().GetDeltaSince(MonoTime::Min()).ToNanoseconds());
   const uint64_t hash = r.Next64();
   code_ = (hash == 0) ? 1 : hash;  // Avoid zero to allow xorShift rehash
 }

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/threadpool.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/threadpool.cc b/src/kudu/util/threadpool.cc
index 1588c8c..c7ec317 100644
--- a/src/kudu/util/threadpool.cc
+++ b/src/kudu/util/threadpool.cc
@@ -183,7 +183,7 @@ Status ThreadPool::SubmitFunc(const boost::function<void()>& func) {
 }
 
 Status ThreadPool::Submit(const std::shared_ptr<Runnable>& task) {
-  MonoTime submit_time = MonoTime::Now(MonoTime::FINE);
+  MonoTime submit_time = MonoTime::Now();
 
   MutexLock guard(lock_);
   if (PREDICT_FALSE(!pool_status_.ok())) {
@@ -254,7 +254,7 @@ void ThreadPool::Wait() {
 }
 
 bool ThreadPool::WaitUntil(const MonoTime& until) {
-  MonoDelta relative = until.GetDeltaSince(MonoTime::Now(MonoTime::FINE));
+  MonoDelta relative = until.GetDeltaSince(MonoTime::Now());
   return WaitFor(relative);
 }
 
@@ -328,7 +328,7 @@ void ThreadPool::DispatchThread(bool permanent) {
     }
 
     // Update metrics
-    MonoTime now(MonoTime::Now(MonoTime::FINE));
+    MonoTime now(MonoTime::Now());
     int64_t queue_time_us = now.GetDeltaSince(entry.submit_time).ToMicroseconds();
     TRACE_COUNTER_INCREMENT(queue_time_trace_metric_name_, queue_time_us);
     if (queue_time_us_histogram_) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/ea81e052/src/kudu/util/throttler-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/util/throttler-test.cc b/src/kudu/util/throttler-test.cc
index f2c47b4..9bf800d 100644
--- a/src/kudu/util/throttler-test.cc
+++ b/src/kudu/util/throttler-test.cc
@@ -30,7 +30,7 @@ class ThrottlerTest : public KuduTest {
 
 TEST_F(ThrottlerTest, TestOpThrottle) {
   // Check operation rate throttling
-  MonoTime now = MonoTime::Now(MonoTime::FINE);
+  MonoTime now = MonoTime::Now();
   Throttler t0(now, 1000, 1000*1000, 1);
   // Fill up bucket
   now.AddDelta(MonoDelta::FromMilliseconds(2000));
@@ -46,7 +46,7 @@ TEST_F(ThrottlerTest, TestOpThrottle) {
 
 TEST_F(ThrottlerTest, TestIOThrottle) {
   // Check operation rate throttling
-  MonoTime now = MonoTime::Now(MonoTime::FINE);
+  MonoTime now = MonoTime::Now();
   Throttler t0(now, 50000, 1000*1000, 1);
   // Fill up bucket
   now.AddDelta(MonoDelta::FromMilliseconds(2000));
@@ -62,7 +62,7 @@ TEST_F(ThrottlerTest, TestIOThrottle) {
 
 TEST_F(ThrottlerTest, TestBurst) {
   // Check IO rate throttling
-  MonoTime now = MonoTime::Now(MonoTime::FINE);
+  MonoTime now = MonoTime::Now();
   Throttler t0(now, 2000, 1000*1000, 5);
   // Fill up bucket
   now.AddDelta(MonoDelta::FromMilliseconds(2000));


Mime
View raw message