diff --git a/VERSION b/VERSION index 1892b92..31e5c84 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.2 +1.3.3 diff --git a/sprockets_postgres.py b/sprockets_postgres.py index 8c2655c..fb3f460 100644 --- a/sprockets_postgres.py +++ b/sprockets_postgres.py @@ -713,7 +713,7 @@ class RequestHandlerMixin: if hasattr(self, 'influxdb'): # sprockets-influxdb self.influxdb.set_field(metric_name, duration) elif hasattr(self, 'record_timing'): # sprockets.mixins.metrics - self.record_timing(metric_name, duration) + self.record_timing(duration, metric_name) else: LOGGER.debug('Postgres query %s duration: %s', metric_name, duration) diff --git a/tests.py b/tests.py index 2542e25..50abf73 100644 --- a/tests.py +++ b/tests.py @@ -405,6 +405,9 @@ class RequestHandlerMixinTestCase(TestCase): self.assertEqual(response.code, 200) self.assertEqual(json.loads(response.body)['value'], expectation) self.app.record_timing.assert_called_once() + duration, metric_name = self.app.record_timing.call_args[0] + self.assertGreater(duration, 0.0) + self.assertEqual('', metric_name) def test_postgres_multirow_get(self): response = self.fetch('/multi-row')