b620081714b58222fc3694725b8368643470e7bc
Override the metric map of each datasource as soon as it is created by the manager. This override comes from a file whose path is provided by a setting in config file. Loading at creation time allows the correct datasource be used when get_backend is called, this allows loading a datasource whose metric names get updated outside the watcher's codebase. The function 'load_metric_map' returns empty-dict in any error case. Also in case the file is empty where safe_load is unable finds any yaml documents, it will return None. [1] Some minor refactoring in the test_manager file for readability and added tests for file load and metric override. 1 - https://pyyaml.org/wiki/PyYAMLDocumentation Change-Id: I1df16245f4c7dfd34066f3ab0553cd67154faa58 Implements: blueprint file-based-metric-map
Team and repository tags
Watcher
OpenStack Watcher provides a flexible and scalable resource optimization service for multi-tenant OpenStack-based clouds. Watcher provides a robust framework to realize a wide range of cloud optimization goals, including the reduction of data center operating costs, increased system performance via intelligent virtual machine migration, increased energy efficiency and more!
- Free software: Apache license
- Wiki: https://wiki.openstack.org/wiki/Watcher
- Source: https://opendev.org/openstack/watcher
- Bugs: https://bugs.launchpad.net/watcher
- Documentation: https://docs.openstack.org/watcher/latest/
- Release notes: https://docs.openstack.org/releasenotes/watcher/
Description
Languages
Python
99.7%
Shell
0.3%