diff --git a/swift/common/db_replicator.py b/swift/common/db_replicator.py index 895be57259..730f9dcdfe 100644 --- a/swift/common/db_replicator.py +++ b/swift/common/db_replicator.py @@ -38,6 +38,9 @@ from swift.common.exceptions import DriveNotMounted, ConnectionTimeout from swift.common.daemon import Daemon +DEBUG_TIMINGS_THRESHOLD = 10 + + def quarantine_db(object_file, server_type): """ In the case that a corrupt file is found, move it to a quarantined area to @@ -116,8 +119,6 @@ class Replicator(Daemon): self.node_timeout = int(conf.get('node_timeout', 10)) self.conn_timeout = float(conf.get('conn_timeout', 0.5)) self.reclaim_age = float(conf.get('reclaim_age', 86400 * 7)) - self.debug_timings_threshold = \ - int(conf.get('debug_timings_threshold', 10)) self._zero_stats() def _zero_stats(self): @@ -493,14 +494,14 @@ class ReplicatorRpc(object): return HTTPNotFound() raise timespan = time.time() - timemark - if timespan > self.debug_timings_threshold: + if timespan > DEBUG_TIMINGS_THRESHOLD: self.logger.debug(_('replicator-rpc-sync time for info: %.02fs') % timespan) if metadata: timemark = time.time() broker.update_metadata(simplejson.loads(metadata)) timespan = time.time() - timemark - if timespan > self.debug_timings_threshold: + if timespan > DEBUG_TIMINGS_THRESHOLD: self.logger.debug(_('replicator-rpc-sync time for ' 'update_metadata: %.02fs') % timespan) if info['put_timestamp'] != put_timestamp or \ @@ -510,13 +511,13 @@ class ReplicatorRpc(object): broker.merge_timestamps( created_at, put_timestamp, delete_timestamp) timespan = time.time() - timemark - if timespan > self.debug_timings_threshold: + if timespan > DEBUG_TIMINGS_THRESHOLD: self.logger.debug(_('replicator-rpc-sync time for ' 'merge_timestamps: %.02fs') % timespan) timemark = time.time() info['point'] = broker.get_sync(id_) timespan = time.time() - timemark - if timespan > self.debug_timings_threshold: + if timespan > DEBUG_TIMINGS_THRESHOLD: self.logger.debug(_('replicator-rpc-sync time for get_sync: ' '%.02fs') % timespan) if hash_ == info['hash'] and info['point'] < remote_sync: @@ -525,7 +526,7 @@ class ReplicatorRpc(object): 'sync_point': remote_sync}]) info['point'] = remote_sync timespan = time.time() - timemark - if timespan > self.debug_timings_threshold: + if timespan > DEBUG_TIMINGS_THRESHOLD: self.logger.debug(_('replicator-rpc-sync time for ' 'merge_syncs: %.02fs') % timespan) return Response(simplejson.dumps(info))