diff --git a/swift/container/sharder.py b/swift/container/sharder.py index adff1df977..b24adbad73 100644 --- a/swift/container/sharder.py +++ b/swift/container/sharder.py @@ -2396,7 +2396,7 @@ class ContainerSharder(ContainerSharderConf, ContainerReplicator): 'state') self.logger.timing_since( 'sharder.sharding.completed', - broker.get_own_shard_range().epoch) + float(broker.get_own_shard_range().epoch)) else: self.info(broker, 'Completed cleaving, DB remaining in ' 'sharding state') diff --git a/test/unit/container/test_sharder.py b/test/unit/container/test_sharder.py index 76387d1379..e809858ddc 100644 --- a/test/unit/container/test_sharder.py +++ b/test/unit/container/test_sharder.py @@ -2476,6 +2476,9 @@ class TestSharder(BaseTestSharder): self.assertEqual('sharder.sharding.cleave', self.logger.log_dict['timing_since'][-1][0][0]) self.assertGreater(self.logger.log_dict['timing_since'][-1][0][1], 0) + for call in self.logger.log_dict['timing_since']: + self.assertNotIsInstance(call[0][1], Timestamp) + self.assertIsInstance(call[0][1], float) lines = sharder.logger.get_lines_for_level('info') self.assertEqual( ["Kick off container cleaving, own shard range in state " @@ -2534,6 +2537,9 @@ class TestSharder(BaseTestSharder): self.assertEqual('sharder.sharding.send_sr', self.logger.log_dict['timing_since'][-1][0][0]) self.assertGreater(self.logger.log_dict['timing_since'][-1][0][1], 0) + for call in self.logger.log_dict['timing_since']: + self.assertNotIsInstance(call[0][1], Timestamp) + self.assertIsInstance(call[0][1], float) def test_cleave_timing_metrics(self): broker = self._make_broker()