diff --git a/management/server/account.go b/management/server/account.go index 49341a67bf8..7159aa9ac1c 100644 --- a/management/server/account.go +++ b/management/server/account.go @@ -476,6 +476,12 @@ func (a *Account) GetPeerNetworkMap( objectCount := int64(len(peersToConnect) + len(expiredPeers) + len(routesUpdate) + len(firewallRules)) metrics.CountNetworkMapObjects(objectCount) metrics.CountGetPeerNetworkMapDuration(time.Since(start)) + + if objectCount > 5000 { + log.WithContext(ctx).Tracef("account: %s has a total resource count of %d objects, "+ + "peers to connect: %d, expired peers: %d, routes: %d, firewall rules: %d", + a.Id, objectCount, len(peersToConnect), len(expiredPeers), len(routesUpdate), len(firewallRules)) + } } return nm diff --git a/management/server/sql_store.go b/management/server/sql_store.go index 08caa87737c..0fb3d391f4d 100644 --- a/management/server/sql_store.go +++ b/management/server/sql_store.go @@ -137,7 +137,7 @@ func (s *SqlStore) SaveAccount(ctx context.Context, account *Account) error { defer func() { elapsed := time.Since(start) if elapsed > 1*time.Second { - log.WithContext(ctx).Warnf("SaveAccount for account %s exceeded 1s, took: %v", account.Id, elapsed) + log.WithContext(ctx).Tracef("SaveAccount for account %s exceeded 1s, took: %v", account.Id, elapsed) } }() @@ -523,7 +523,7 @@ func (s *SqlStore) GetAccount(ctx context.Context, accountID string) (*Account, defer func() { elapsed := time.Since(start) if elapsed > 1*time.Second { - log.WithContext(ctx).Warnf("GetAccount for account %s exceeded 1s, took: %v", accountID, elapsed) + log.WithContext(ctx).Tracef("GetAccount for account %s exceeded 1s, took: %v", accountID, elapsed) } }() @@ -590,16 +590,6 @@ func (s *SqlStore) GetAccount(ctx context.Context, accountID string) (*Account, } account.NameServerGroupsG = nil - totalObjects := len(account.Policies) + - len(account.RoutesG) + - len(account.SetupKeysG) + - len(account.PeersG) + - len(account.NameServerGroupsG) + - len(account.Policies) - if totalObjects > 5000 { - log.WithContext(ctx).Debugf("account: %s has a total resource count of %d objects, exceeding 5,000", accountID, totalObjects) - } - return &account, nil }