From e07298594eb2a6295ac3f9c32c90c7361babca9a Mon Sep 17 00:00:00 2001 From: James Phillips Date: Tue, 9 Aug 2016 11:32:12 -0700 Subject: [PATCH] Adds I/O-sensitive metrics to ACL replication operations. --- consul/acl_replication.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/consul/acl_replication.go b/consul/acl_replication.go index 573b562513..3b767edb0b 100644 --- a/consul/acl_replication.go +++ b/consul/acl_replication.go @@ -150,6 +150,8 @@ func (s *Server) fetchLocalACLs() (structs.ACLs, error) { // datacenter. The lastIndex parameter is a hint about which remote index we // have replicated to, so this is expected to block until something changes. func (s *Server) fetchRemoteACLs(lastRemoteIndex uint64) (*structs.IndexedACLs, error) { + defer metrics.MeasureSince([]string{"consul", "leader", "fetchRemoteACLs"}, time.Now()) + args := structs.DCSpecificRequest{ Datacenter: s.config.ACLDatacenter, QueryOptions: structs.QueryOptions{ @@ -168,6 +170,8 @@ func (s *Server) fetchRemoteACLs(lastRemoteIndex uint64) (*structs.IndexedACLs, // UpdateLocalACLs is given a list of changes to apply in order to bring the // local ACLs in-line with the remote ACLs from the ACL datacenter. func (s *Server) updateLocalACLs(changes structs.ACLRequests) error { + defer metrics.MeasureSince([]string{"consul", "leader", "updateLocalACLs"}, time.Now()) + minTimePerOp := time.Second / time.Duration(s.config.ACLReplicationApplyLimit) for _, change := range changes { // Note that we are using the single ACL interface here and not