From 705ad0752467f887040523784799ff075ec48c0b Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Fri, 25 Sep 2020 19:10:07 +0000 Subject: [PATCH] A few other "metric" names in files touched in previous renaming PRs --- cms/envs/common.py | 2 +- lms/envs/common.py | 2 +- openedx/core/djangoapps/oauth_dispatch/tests/test_views.py | 4 ++-- .../schedules/management/commands/tests/send_email_base.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cms/envs/common.py b/cms/envs/common.py index b693a87ff9..d6e45e23f6 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -724,7 +724,7 @@ MIDDLEWARE = [ # Enables force_django_cache_miss functionality for TieredCache. 'edx_django_utils.cache.middleware.TieredCacheMiddleware', - # Outputs monitoring metrics for a request. + # Adds monitoring attributes to requests. 'edx_rest_framework_extensions.middleware.RequestMetricsMiddleware', 'edx_rest_framework_extensions.auth.jwt.middleware.EnsureJWTAuthSettingsMiddleware', diff --git a/lms/envs/common.py b/lms/envs/common.py index fd57e7d342..a32dc19cbd 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -1762,7 +1762,7 @@ MIDDLEWARE = [ # Enables force_django_cache_miss functionality for TieredCache. 'edx_django_utils.cache.middleware.TieredCacheMiddleware', - # Outputs monitoring metrics for a request. + # Adds monitoring attributes to requests. 'edx_rest_framework_extensions.middleware.RequestMetricsMiddleware', 'edx_rest_framework_extensions.auth.jwt.middleware.EnsureJWTAuthSettingsMiddleware', diff --git a/openedx/core/djangoapps/oauth_dispatch/tests/test_views.py b/openedx/core/djangoapps/oauth_dispatch/tests/test_views.py index 38946d2a8c..13184ae2cd 100644 --- a/openedx/core/djangoapps/oauth_dispatch/tests/test_views.py +++ b/openedx/core/djangoapps/oauth_dispatch/tests/test_views.py @@ -234,7 +234,7 @@ class TestAccessTokenView(AccessTokenLoginMixin, mixins.AccessTokenMixin, _Dispa ) @ddt.unpack @patch('edx_django_utils.monitoring.set_custom_attribute') - def test_access_token_metrics(self, token_type, expected_token_type, mock_set_custom_attribute): + def test_access_token_attributes(self, token_type, expected_token_type, mock_set_custom_attribute): response = self._post_request(self.user, self.dot_app, token_type=token_type) self.assertEqual(response.status_code, 200) expected_calls = [ @@ -244,7 +244,7 @@ class TestAccessTokenView(AccessTokenLoginMixin, mixins.AccessTokenMixin, _Dispa mock_set_custom_attribute.assert_has_calls(expected_calls, any_order=True) @patch('edx_django_utils.monitoring.set_custom_attribute') - def test_access_token_metrics_for_bad_request(self, mock_set_custom_attribute): + def test_access_token_attributes_for_bad_request(self, mock_set_custom_attribute): grant_type = dot_models.Application.GRANT_PASSWORD invalid_body = { 'grant_type': grant_type.replace('-', '_'), diff --git a/openedx/core/djangoapps/schedules/management/commands/tests/send_email_base.py b/openedx/core/djangoapps/schedules/management/commands/tests/send_email_base.py index a3fc7e8463..4474d5feb6 100644 --- a/openedx/core/djangoapps/schedules/management/commands/tests/send_email_base.py +++ b/openedx/core/djangoapps/schedules/management/commands/tests/send_email_base.py @@ -197,7 +197,7 @@ class ScheduleSendEmailTestMixin(FilteredQueryCountMixin): @ddt.data(1, 10, 100) @patch.object(tasks, 'ace') @patch.object(resolvers, 'set_custom_attribute') - def test_schedule_bin(self, schedule_count, mock_metric, mock_ace): + def test_schedule_bin(self, schedule_count, mock_attribute, mock_ace): with patch.object(self.task, 'async_send_task') as mock_schedule_send: current_day, offset, target_day, upgrade_deadline = self._get_dates() schedules = [ @@ -226,7 +226,7 @@ class ScheduleSendEmailTestMixin(FilteredQueryCountMixin): site_id=self.site_config.site.id, target_day_str=target_day_str, day_offset=offset, bin_num=b, )) - num_schedules = mock_metric.call_args[0][1] + num_schedules = mock_attribute.call_args[0][1] if b in bins_in_use: self.assertGreater(num_schedules, 0) else: