Mike Percy has posted comments on this change. ( http://gerrit.cloudera.org:8080/10076 )
Change subject: KUDU-2287 Expose election failures as metrics ...................................................................... Patch Set 16: (1 comment) http://gerrit.cloudera.org:8080/#/c/10076/15/src/kudu/consensus/raft_consensus.cc File src/kudu/consensus/raft_consensus.cc: http://gerrit.cloudera.org:8080/#/c/10076/15/src/kudu/consensus/raft_consensus.cc@3003 PS15, Line 3003: 0 : MonoTime::Now().GetDeltaSince(last_leader_heartbeat_.get()).ToNanoseconds(); > std::atomic doesn't seem to like boost::optional, so I can either do lockin I think it would be best to use a std::atomic<int64_t> for last_leader_communication_time_micros_ and update it any time we get an UpdateConsensus RPC from the leader with GetMonoTimeMicros(). To calculate this metric I was thinking about something like: (GetMonoTimeMicros() - last_leader_communication_time_micros_) / 1000 since milliseconds seems like the most useful level of time granularity to use for a metric tracking when we last heard from the leader when the default heartbeat period is 500ms. -- To view, visit http://gerrit.cloudera.org:8080/10076 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1b25df258cdba7bdae7bb2d7b4eb3d73b53425c3 Gerrit-Change-Number: 10076 Gerrit-PatchSet: 16 Gerrit-Owner: Attila Bukor <[email protected]> Gerrit-Reviewer: Attila Bukor <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <[email protected]> Gerrit-Reviewer: Tidy Bot Gerrit-Reviewer: Todd Lipcon <[email protected]> Gerrit-Reviewer: Will Berkeley <[email protected]> Gerrit-Comment-Date: Sat, 26 May 2018 00:50:05 +0000 Gerrit-HasComments: Yes
