diff --git a/ChangeLog b/ChangeLog index 98a61bcc..fa9f9eed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,25 @@ PyU4V Change Log ================ +Version 9.2.0.2 - released 14/10/20 +=================================== +- When generating threshold CSV files from + PerformanceFunctions.generate_threshold_settings_csv it is now possible to + set category as an input value to limit the CSV threshold file to only that + performance category. +- CI tests for thresholds have been updated to target a default threshold + marked as KPI to ensure it has both first and second threshold values + populated before the test runs. +- Removed trailing white space from two performance metrics in the metric map, + 'BEDisk ReadResponseTime ' is now 'BEDiskReadResponseTime' in diagnostic + category 'DeviceGroup', and, 'BEReadRequestTime ' is now 'BEReadRequestTime' + in category 'StorageContainer'. + + Version 9.2.0.1 - released 12/10/20 =================================== --Tighten base CI tests around RDF group creation and deletion. --Update Unisphere minimum version to reflect 9.2 GA Unisphere version. +- Tighten base CI tests around RDF group creation and deletion. +- Update Unisphere minimum version to reflect 9.2 GA Unisphere version. Version 9.2.0.0 - released 29/09/20 diff --git a/PyU4V/__init__.py b/PyU4V/__init__.py index ba2f68a2..37eb4b96 100644 --- a/PyU4V/__init__.py +++ b/PyU4V/__init__.py @@ -23,7 +23,7 @@ from .univmax_conn import U4VConn # noqa: F401 __title__ = 'pyu4v' -__version__ = '9.2.0.1' +__version__ = '9.2.0.2' __author__ = 'Dell EMC or its subsidiaries' __license__ = 'Apache 2.0' __copyright__ = 'Copyright 2020 Dell EMC Inc' diff --git a/PyU4V/performance.py b/PyU4V/performance.py index 09426fb7..9bf68bf4 100644 --- a/PyU4V/performance.py +++ b/PyU4V/performance.py @@ -902,7 +902,7 @@ def update_threshold_settings( resource_type=pc.UPDATE, resource_type_id=category, payload=payload) - def generate_threshold_settings_csv(self, output_csv_path): + def generate_threshold_settings_csv(self, output_csv_path, category=None): """Generate a csv file with threshold settings. Creates a CSV file with current alert configuration for the given @@ -910,8 +910,10 @@ def generate_threshold_settings_csv(self, output_csv_path): alert_user, kpi. :param output_csv_path: filename for CSV to be generated -- str + :param category: threshold specific category -- str """ - category_list = self.get_threshold_categories() + category_list = ( + self.get_threshold_categories() if not category else [category]) data_for_csv = list() data_for_csv.append([pc.CATEGORY, pc.METRIC, pc.FIRST_THRESH, pc.SEC_THRESH, pc.ALERT_ERR, pc.KPI]) @@ -969,6 +971,14 @@ def _str_to_bool(str_in): for i in range(0, len(metric_list)): if not _str_to_bool(is_kpi[i]) and kpi_only: continue + if int(f_threshold_list[i]) >= int(s_threshold_list[i]): + LOG.warning( + 'Not setting performance metric {m} threshold, second ' + 'threshold value {f} must be greater than first threshold ' + 'value {s}.'.format( + m=metric_list[i], f=f_threshold_list[i], + s=s_threshold_list[i])) + continue self.update_threshold_settings( category=category_list[i], metric=metric_list[i], alert=notify_list[i], first_threshold=f_threshold_list[i], diff --git a/PyU4V/tests/ci_tests/test_pyu4v_ci_performance.py b/PyU4V/tests/ci_tests/test_pyu4v_ci_performance.py index 7cbbe637..2a3a506a 100644 --- a/PyU4V/tests/ci_tests/test_pyu4v_ci_performance.py +++ b/PyU4V/tests/ci_tests/test_pyu4v_ci_performance.py @@ -364,7 +364,7 @@ def test_set_perf_threshold_and_alert(self): def test_update_threshold_settings(self): """Test set_perf_threshold_and_alert.""" - metric = 'ReadResponseTime' + metric = 'PercentCacheWP' alert, f_threshold, s_threshold = None, None, None cat_thresh_settings = self.perf.get_threshold_category_settings( @@ -466,7 +466,8 @@ def test_set_thresholds_from_csv(self): csv_file_name = 'test.csv' temp_dir = self.create_temp_directory() csv_file_path = os.path.join(temp_dir, csv_file_name) - self.perf.generate_threshold_settings_csv(csv_file_path) + self.perf.generate_threshold_settings_csv(csv_file_path, + category='Array') self.assertTrue(os.path.isfile(csv_file_path)) # Read CSV file csv_data = file_handler.read_csv_values(csv_file_path) @@ -474,15 +475,14 @@ def test_set_thresholds_from_csv(self): num_metrics = len(csv_data.get('metric')) orig_values = (0, 0) updated_values = (0, 0) - metric_set = 'ReadResponseTime' + metric_set = 'PercentCacheWP' for i in range(0, num_metrics): - category = csv_data.get(pc.CATEGORY)[i] metric = csv_data.get(pc.METRIC)[i] - if category == pc.ARRAY and metric == metric_set: + if metric == metric_set: orig_values = (csv_data.get(pc.FIRST_THRESH)[i], csv_data.get(pc.SEC_THRESH)[i]) updated_values = (int(orig_values[0]) + 5, - int(orig_values[1]) + 5) + int(orig_values[1]) + 10) csv_data[pc.FIRST_THRESH][i] = updated_values[0] csv_data[pc.SEC_THRESH][i] = updated_values[1] csv_data[pc.KPI][i] = True diff --git a/PyU4V/tests/unit_tests/test_pyu4v_performance.py b/PyU4V/tests/unit_tests/test_pyu4v_performance.py index 2a0d1b77..581933a7 100644 --- a/PyU4V/tests/unit_tests/test_pyu4v_performance.py +++ b/PyU4V/tests/unit_tests/test_pyu4v_performance.py @@ -866,6 +866,32 @@ def test_set_thresholds_from_csv(self): self.perf.set_thresholds_from_csv('fake_csv_path') self.assertEqual(mck_update.call_count, 1) + def test_set_thresholds_from_csv_invalid_threshold_values(self): + """Test set_perfthresholds_csv.""" + threshold_settings = self.p_data.threshold_settings_resp.get( + pc.PERF_THRESH) + + mock_csv_data = {pc.CATEGORY: list(), pc.METRIC: list(), + pc.KPI: list(), pc.ALERT_ERR: list(), + pc.FIRST_THRESH: list(), pc.SEC_THRESH: list()} + + for threshold_setting in threshold_settings: + mock_csv_data[pc.CATEGORY].append( + self.p_data.threshold_settings_resp.get(pc.CATEGORY)) + mock_csv_data[pc.METRIC].append(threshold_setting.get(pc.METRIC)) + mock_csv_data[pc.KPI].append(threshold_setting.get(pc.KPI)) + mock_csv_data[pc.ALERT_ERR].append( + threshold_setting.get(pc.ALERT_ERR)) + mock_csv_data[pc.FIRST_THRESH].append(10) + mock_csv_data[pc.SEC_THRESH].append(10) + + with mock.patch.object(file_handler, 'read_csv_values', + return_value=mock_csv_data): + with mock.patch.object( + self.perf, 'update_threshold_settings') as mck_update: + self.perf.set_thresholds_from_csv('fake_csv_path') + self.assertEqual(mck_update.call_count, 0) + def test_generate_threshold_settings_csv(self): """Test generate_threshold_settings_csv.""" data_for_csv = list() diff --git a/PyU4V/utils/constants.py b/PyU4V/utils/constants.py index 536ac7fe..11fe84a9 100644 --- a/PyU4V/utils/constants.py +++ b/PyU4V/utils/constants.py @@ -39,7 +39,7 @@ APP_MPART = 'multipart/form-data' # Unisphere REST URI constants -PYU4V_VERSION = '9.2.0.1' +PYU4V_VERSION = '9.2.0.2' UNISPHERE_VERSION = '92' VERSION = 'version' ITERATOR = 'Iterator' diff --git a/PyU4V/utils/performance_category_map.py b/PyU4V/utils/performance_category_map.py index 4ea3d94a..bab971e6 100644 --- a/PyU4V/utils/performance_category_map.py +++ b/PyU4V/utils/performance_category_map.py @@ -213,7 +213,7 @@ 'metrics_kpi_cnt': 29, 'metrics_all': [ 'AllocatedCapacity', 'AvgIOSize', 'AvgReadSize', - 'AvgWritePacedDelay', 'AvgWriteSize', 'BEDisk ReadResponseTime ', + 'AvgWritePacedDelay', 'AvgWriteSize', 'BEDiskReadResponseTime', 'BEMBReads', 'BEMBTransferred', 'BEMBWritten', 'BEPercentReads', 'BEPercentWrites', 'BEPrefetchedMBs', 'BEPrefetchedTrackUsed', 'BEPrefetchedTrackss', 'BERdfCopy', 'BERdfCopyMB', 'BEReadReqs', @@ -652,7 +652,7 @@ 'BEDiskReadResponseTime', 'BEMBReads', 'BEMBTransferred', 'BEMBWritten', 'BEPercentReads', 'BEPercentWrites', 'BEPrefetchedMBs', 'BEPrefetchedTrackUsed', 'BEPrefetchedTrackss', - 'BEReadReqs', 'BEReadRequestTime ', 'BEReadTaskTime', 'BEReqs', + 'BEReadReqs', 'BEReadRequestTime', 'BEReadTaskTime', 'BEReqs', 'BEWriteReqs', 'BlockSize', 'CompressedTracks', 'CriticalAlertCount', 'HostHits', 'HostIOLimitPercentTimeExceeded', 'HostIOs', 'HostMBReads', 'HostMBWritten', 'HostMBs', diff --git a/README.rst b/README.rst index 21cd010e..2b2cc0a7 100644 --- a/README.rst +++ b/README.rst @@ -26,7 +26,7 @@ PyU4V Version 9.2 +-------------------------------+----------------------------+ | **Author** | Dell EMC | +-------------------------------+----------------------------+ -| **PyU4V Version** | 9.2.0.1 | +| **PyU4V Version** | 9.2.0.2 | +-------------------------------+----------------------------+ | **Minimum Unisphere Version** | 9.2.0.1 | +-------------------------------+----------------------------+ @@ -80,7 +80,7 @@ specifying ``PyU4V`` as the install package for ``pip``:: $ pip install PyU4V # Install a specific version - $ pip install PyU4V==9.2.0.1 + $ pip install PyU4V==9.2.0.2 Copy the sample ``PyU4V.conf`` provided with PyU4V to either your working directory or within a directory named ``.PyU4V`` in your current users home diff --git a/docs/source/conf.py b/docs/source/conf.py index 8404a762..1b744539 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -26,7 +26,7 @@ # The short X.Y version. version = u'9.2' # The full version, including alpha/beta/rc tags -release = '9.2.0.1' +release = '9.2.0.2' # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: diff --git a/docs/source/index.rst b/docs/source/index.rst index 5a2ee0c1..30de5e99 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -35,7 +35,7 @@ Supported PyU4V Versions ------------------------ +-------------------------------+----------------------------------------+ -| **PyU4V Version** | 9.2.0.1 | +| **PyU4V Version** | 9.2.0.2 | +-------------------------------+----------------------------------------+ | **Minimum Unisphere Version** | 9.2.0.1 | +-------------------------------+----------------------------------------+ diff --git a/docs/source/installation.rst b/docs/source/installation.rst index c71e1cba..e3cecc00 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -5,7 +5,7 @@ Requirements ------------ +-------------------------------+----------------------------------------+ -| **PyU4V Version** | 9.2.0.1 | +| **PyU4V Version** | 9.2.0.2 | +-------------------------------+----------------------------------------+ | **Minimum Unisphere Version** | 9.2.0.1 | +-------------------------------+----------------------------------------+ @@ -66,7 +66,7 @@ specifying ``PyU4V`` as the install package for ``pip``: $ pip install PyU4V # Install a specific version - $ pip install PyU4V==9.2.0.1 + $ pip install PyU4V==9.2.0.2 .. URL LINKS diff --git a/setup.py b/setup.py index 0f6c9d75..af1bef3d 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ setuptools.setup( name='PyU4V', - version='9.2.0.1', + version='9.2.0.2', url='https://github.com/dell/PyU4V/', author='Dell Inc. or its subsidiaries', author_email='Michael.Mcaleer@dell.com',