Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
090b695956 | ||
|
|
3874ca82de | ||
|
|
b5431b2e53 | ||
|
|
c3640ed64e | ||
|
|
1f8566a9ea | ||
|
|
1e11c490a7 | ||
|
|
8a7a8db661 | ||
|
|
0610070e59 | ||
|
|
a0997a0423 | ||
|
|
4ea3eada3e | ||
|
|
cd1c0f3054 | ||
|
|
684350977d | ||
|
|
d28630b759 | ||
|
|
f7fbaf46a2 | ||
|
|
e7cda537e7 | ||
|
|
c7be34fbaa | ||
|
|
52da088011 | ||
|
|
6ac3a6febf | ||
|
|
e36b77ad6d | ||
|
|
6003322711 | ||
|
|
f4ffca01b8 | ||
|
|
5d70c207cd | ||
|
|
0b2e641d00 | ||
|
|
ff84b052a5 | ||
|
|
a43b040ebc | ||
|
|
749fa2507a | ||
|
|
76d61362ee | ||
|
|
c55143bc21 | ||
|
|
7609df3370 | ||
|
|
b57eac12cb | ||
|
|
ac6911d3c4 | ||
|
|
23c2010681 |
@@ -2,3 +2,4 @@
|
|||||||
host=review.opendev.org
|
host=review.opendev.org
|
||||||
port=29418
|
port=29418
|
||||||
project=openstack/watcher.git
|
project=openstack/watcher.git
|
||||||
|
defaultbranch=stable/2023.2
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
- project:
|
- project:
|
||||||
|
queue: watcher
|
||||||
templates:
|
templates:
|
||||||
- check-requirements
|
- check-requirements
|
||||||
- openstack-cover-jobs
|
- openstack-cover-jobs
|
||||||
- openstack-python3-yoga-jobs
|
- openstack-python3-jobs
|
||||||
- publish-openstack-docs-pti
|
- publish-openstack-docs-pti
|
||||||
- release-notes-jobs-python3
|
- release-notes-jobs-python3
|
||||||
check:
|
check:
|
||||||
@@ -14,7 +15,6 @@
|
|||||||
- watcherclient-tempest-functional
|
- watcherclient-tempest-functional
|
||||||
- watcher-tempest-functional-ipv6-only
|
- watcher-tempest-functional-ipv6-only
|
||||||
gate:
|
gate:
|
||||||
queue: watcher
|
|
||||||
jobs:
|
jobs:
|
||||||
- watcher-tempest-functional
|
- watcher-tempest-functional
|
||||||
- watcher-tempest-functional-ipv6-only
|
- watcher-tempest-functional-ipv6-only
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
- job:
|
- job:
|
||||||
name: watcher-tempest-multinode
|
name: watcher-tempest-multinode
|
||||||
parent: watcher-tempest-functional
|
parent: watcher-tempest-functional
|
||||||
nodeset: openstack-two-node-focal
|
nodeset: openstack-two-node-jammy
|
||||||
roles:
|
roles:
|
||||||
- zuul: openstack/tempest
|
- zuul: openstack/tempest
|
||||||
group-vars:
|
group-vars:
|
||||||
@@ -107,6 +107,7 @@
|
|||||||
watcher-api: false
|
watcher-api: false
|
||||||
watcher-decision-engine: true
|
watcher-decision-engine: true
|
||||||
watcher-applier: false
|
watcher-applier: false
|
||||||
|
c-bak: false
|
||||||
ceilometer: false
|
ceilometer: false
|
||||||
ceilometer-acompute: false
|
ceilometer-acompute: false
|
||||||
ceilometer-acentral: false
|
ceilometer-acentral: false
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ source_suffix = '.rst'
|
|||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'Watcher'
|
project = 'Watcher'
|
||||||
copyright = u'OpenStack Foundation'
|
copyright = 'OpenStack Foundation'
|
||||||
|
|
||||||
# A list of ignored prefixes for module index sorting.
|
# A list of ignored prefixes for module index sorting.
|
||||||
modindex_common_prefix = ['watcher.']
|
modindex_common_prefix = ['watcher.']
|
||||||
@@ -91,14 +91,14 @@ pygments_style = 'native'
|
|||||||
# List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual'
|
# List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual'
|
||||||
|
|
||||||
man_pages = [
|
man_pages = [
|
||||||
('man/watcher-api', 'watcher-api', u'Watcher API Server',
|
('man/watcher-api', 'watcher-api', 'Watcher API Server',
|
||||||
[u'OpenStack'], 1),
|
['OpenStack'], 1),
|
||||||
('man/watcher-applier', 'watcher-applier', u'Watcher Applier',
|
('man/watcher-applier', 'watcher-applier', 'Watcher Applier',
|
||||||
[u'OpenStack'], 1),
|
['OpenStack'], 1),
|
||||||
('man/watcher-db-manage', 'watcher-db-manage',
|
('man/watcher-db-manage', 'watcher-db-manage',
|
||||||
u'Watcher Db Management Utility', [u'OpenStack'], 1),
|
'Watcher Db Management Utility', ['OpenStack'], 1),
|
||||||
('man/watcher-decision-engine', 'watcher-decision-engine',
|
('man/watcher-decision-engine', 'watcher-decision-engine',
|
||||||
u'Watcher Decision Engine', [u'OpenStack'], 1),
|
'Watcher Decision Engine', ['OpenStack'], 1),
|
||||||
]
|
]
|
||||||
|
|
||||||
# -- Options for HTML output --------------------------------------------------
|
# -- Options for HTML output --------------------------------------------------
|
||||||
@@ -128,8 +128,8 @@ openstackdocs_bug_tag = ''
|
|||||||
latex_documents = [
|
latex_documents = [
|
||||||
('index',
|
('index',
|
||||||
'doc-watcher.tex',
|
'doc-watcher.tex',
|
||||||
u'Watcher Documentation',
|
'Watcher Documentation',
|
||||||
u'OpenStack Foundation', 'manual'),
|
'OpenStack Foundation', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# If false, no module index is generated.
|
# If false, no module index is generated.
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ You can configure and install Ceilometer by following the documentation below :
|
|||||||
#. https://docs.openstack.org/ceilometer/latest
|
#. https://docs.openstack.org/ceilometer/latest
|
||||||
|
|
||||||
The built-in strategy 'basic_consolidation' provided by watcher requires
|
The built-in strategy 'basic_consolidation' provided by watcher requires
|
||||||
"**compute.node.cpu.percent**" and "**cpu_util**" measurements to be collected
|
"**compute.node.cpu.percent**" and "**cpu**" measurements to be collected
|
||||||
by Ceilometer.
|
by Ceilometer.
|
||||||
The measurements available depend on the hypervisors that OpenStack manages on
|
The measurements available depend on the hypervisors that OpenStack manages on
|
||||||
the specific implementation.
|
the specific implementation.
|
||||||
|
|||||||
@@ -300,6 +300,6 @@ Using that you can now query the values for that specific metric:
|
|||||||
.. code-block:: py
|
.. code-block:: py
|
||||||
|
|
||||||
avg_meter = self.datasource_backend.statistic_aggregation(
|
avg_meter = self.datasource_backend.statistic_aggregation(
|
||||||
instance.uuid, 'cpu_util', self.periods['instance'],
|
instance.uuid, 'instance_cpu_usage', self.periods['instance'],
|
||||||
self.granularity,
|
self.granularity,
|
||||||
aggregation=self.aggregation_method['instance'])
|
aggregation=self.aggregation_method['instance'])
|
||||||
|
|||||||
@@ -26,8 +26,7 @@ metric service name plugins comment
|
|||||||
``compute_monitors`` option
|
``compute_monitors`` option
|
||||||
to ``cpu.virt_driver`` in
|
to ``cpu.virt_driver`` in
|
||||||
the nova.conf.
|
the nova.conf.
|
||||||
``cpu_util`` ceilometer_ none cpu_util has been removed
|
``cpu`` ceilometer_ none
|
||||||
since Stein.
|
|
||||||
============================ ============ ======= ===========================
|
============================ ============ ======= ===========================
|
||||||
|
|
||||||
.. _ceilometer: https://docs.openstack.org/ceilometer/latest/admin/telemetry-measurements.html#openstack-compute
|
.. _ceilometer: https://docs.openstack.org/ceilometer/latest/admin/telemetry-measurements.html#openstack-compute
|
||||||
|
|||||||
@@ -89,9 +89,9 @@ step 2: Create audit to do optimization
|
|||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
$ openstack optimize audittemplate create \
|
$ openstack optimize audittemplate create \
|
||||||
at1 saving_energy --strategy saving_energy
|
saving_energy_template1 saving_energy --strategy saving_energy
|
||||||
|
|
||||||
$ openstack optimize audit create -a at1 \
|
$ openstack optimize audit create -a saving_energy_audit1 \
|
||||||
-p free_used_percent=20.0
|
-p free_used_percent=20.0
|
||||||
|
|
||||||
External Links
|
External Links
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ The *vm_workload_consolidation* strategy requires the following metrics:
|
|||||||
============================ ============ ======= =========================
|
============================ ============ ======= =========================
|
||||||
metric service name plugins comment
|
metric service name plugins comment
|
||||||
============================ ============ ======= =========================
|
============================ ============ ======= =========================
|
||||||
``cpu_util`` ceilometer_ none cpu_util has been removed
|
``cpu`` ceilometer_ none
|
||||||
since Stein.
|
|
||||||
``memory.resident`` ceilometer_ none
|
``memory.resident`` ceilometer_ none
|
||||||
``memory`` ceilometer_ none
|
``memory`` ceilometer_ none
|
||||||
``disk.root.size`` ceilometer_ none
|
``disk.root.size`` ceilometer_ none
|
||||||
|
|||||||
@@ -27,9 +27,8 @@ metric service name plugins comment
|
|||||||
to ``cpu.virt_driver`` in the
|
to ``cpu.virt_driver`` in the
|
||||||
nova.conf.
|
nova.conf.
|
||||||
``hardware.memory.used`` ceilometer_ SNMP_
|
``hardware.memory.used`` ceilometer_ SNMP_
|
||||||
``cpu_util`` ceilometer_ none cpu_util has been removed
|
``cpu`` ceilometer_ none
|
||||||
since Stein.
|
``instance_ram_usage`` ceilometer_ none
|
||||||
``memory.resident`` ceilometer_ none
|
|
||||||
============================ ============ ======= =============================
|
============================ ============ ======= =============================
|
||||||
|
|
||||||
.. _ceilometer: https://docs.openstack.org/ceilometer/latest/admin/telemetry-measurements.html#openstack-compute
|
.. _ceilometer: https://docs.openstack.org/ceilometer/latest/admin/telemetry-measurements.html#openstack-compute
|
||||||
@@ -107,10 +106,10 @@ parameter type default Value description
|
|||||||
period of all received ones.
|
period of all received ones.
|
||||||
==================== ====== ===================== =============================
|
==================== ====== ===================== =============================
|
||||||
|
|
||||||
.. |metrics| replace:: ["cpu_util", "memory.resident"]
|
.. |metrics| replace:: ["instance_cpu_usage", "instance_ram_usage"]
|
||||||
.. |thresholds| replace:: {"cpu_util": 0.2, "memory.resident": 0.2}
|
.. |thresholds| replace:: {"instance_cpu_usage": 0.2, "instance_ram_usage": 0.2}
|
||||||
.. |weights| replace:: {"cpu_util_weight": 1.0, "memory.resident_weight": 1.0}
|
.. |weights| replace:: {"instance_cpu_usage_weight": 1.0, "instance_ram_usage_weight": 1.0}
|
||||||
.. |instance_metrics| replace:: {"cpu_util": "compute.node.cpu.percent", "memory.resident": "hardware.memory.used"}
|
.. |instance_metrics| replace:: {"instance_cpu_usage": "compute.node.cpu.percent", "instance_ram_usage": "hardware.memory.used"}
|
||||||
.. |periods| replace:: {"instance": 720, "node": 600}
|
.. |periods| replace:: {"instance": 720, "node": 600}
|
||||||
|
|
||||||
Efficacy Indicator
|
Efficacy Indicator
|
||||||
@@ -136,8 +135,8 @@ How to use it ?
|
|||||||
at1 workload_balancing --strategy workload_stabilization
|
at1 workload_balancing --strategy workload_stabilization
|
||||||
|
|
||||||
$ openstack optimize audit create -a at1 \
|
$ openstack optimize audit create -a at1 \
|
||||||
-p thresholds='{"memory.resident": 0.05}' \
|
-p thresholds='{"instance_ram_usage": 0.05}' \
|
||||||
-p metrics='["memory.resident"]'
|
-p metrics='["instance_ram_usage"]'
|
||||||
|
|
||||||
External Links
|
External Links
|
||||||
--------------
|
--------------
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ The *workload_balance* strategy requires the following metrics:
|
|||||||
======================= ============ ======= =========================
|
======================= ============ ======= =========================
|
||||||
metric service name plugins comment
|
metric service name plugins comment
|
||||||
======================= ============ ======= =========================
|
======================= ============ ======= =========================
|
||||||
``cpu_util`` ceilometer_ none cpu_util has been removed
|
``cpu`` ceilometer_ none
|
||||||
since Stein.
|
|
||||||
``memory.resident`` ceilometer_ none
|
``memory.resident`` ceilometer_ none
|
||||||
======================= ============ ======= =========================
|
======================= ============ ======= =========================
|
||||||
|
|
||||||
@@ -65,15 +64,16 @@ Configuration
|
|||||||
|
|
||||||
Strategy parameters are:
|
Strategy parameters are:
|
||||||
|
|
||||||
============== ====== ============= ====================================
|
============== ====== ==================== ====================================
|
||||||
parameter type default Value description
|
parameter type default Value description
|
||||||
============== ====== ============= ====================================
|
============== ====== ==================== ====================================
|
||||||
``metrics`` String 'cpu_util' Workload balance base on cpu or ram
|
``metrics`` String 'instance_cpu_usage' Workload balance base on cpu or ram
|
||||||
utilization. choice: ['cpu_util',
|
utilization. Choices:
|
||||||
'memory.resident']
|
['instance_cpu_usage',
|
||||||
``threshold`` Number 25.0 Workload threshold for migration
|
'instance_ram_usage']
|
||||||
``period`` Number 300 Aggregate time period of ceilometer
|
``threshold`` Number 25.0 Workload threshold for migration
|
||||||
============== ====== ============= ====================================
|
``period`` Number 300 Aggregate time period of ceilometer
|
||||||
|
============== ====== ==================== ====================================
|
||||||
|
|
||||||
Efficacy Indicator
|
Efficacy Indicator
|
||||||
------------------
|
------------------
|
||||||
@@ -95,7 +95,7 @@ How to use it ?
|
|||||||
at1 workload_balancing --strategy workload_balance
|
at1 workload_balancing --strategy workload_balance
|
||||||
|
|
||||||
$ openstack optimize audit create -a at1 -p threshold=26.0 \
|
$ openstack optimize audit create -a at1 -p threshold=26.0 \
|
||||||
-p period=310 -p metrics=cpu_util
|
-p period=310 -p metrics=instance_cpu_usage
|
||||||
|
|
||||||
External Links
|
External Links
|
||||||
--------------
|
--------------
|
||||||
|
|||||||
6
releasenotes/source/2023.1.rst
Normal file
6
releasenotes/source/2023.1.rst
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
===========================
|
||||||
|
2023.1 Series Release Notes
|
||||||
|
===========================
|
||||||
|
|
||||||
|
.. release-notes::
|
||||||
|
:branch: stable/2023.1
|
||||||
@@ -53,7 +53,7 @@ source_suffix = '.rst'
|
|||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
copyright = u'2016, Watcher developers'
|
copyright = '2016, Watcher developers'
|
||||||
|
|
||||||
# Release notes are version independent
|
# Release notes are version independent
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
@@ -196,8 +196,8 @@ latex_elements = {
|
|||||||
# Grouping the document tree into LaTeX files. List of tuples
|
# Grouping the document tree into LaTeX files. List of tuples
|
||||||
# (source start file, target name, title, author, documentclass [howto/manual])
|
# (source start file, target name, title, author, documentclass [howto/manual])
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
('index', 'watcher.tex', u'Watcher Documentation',
|
('index', 'watcher.tex', 'Watcher Documentation',
|
||||||
u'Watcher developers', 'manual'),
|
'Watcher developers', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
@@ -226,8 +226,8 @@ latex_documents = [
|
|||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
('index', 'watcher', u'Watcher Documentation',
|
('index', 'watcher', 'Watcher Documentation',
|
||||||
[u'Watcher developers'], 1)
|
['Watcher developers'], 1)
|
||||||
]
|
]
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
# If true, show URL addresses after external links.
|
||||||
@@ -240,8 +240,8 @@ man_pages = [
|
|||||||
# (source start file, target name, title, author,
|
# (source start file, target name, title, author,
|
||||||
# dir menu entry, description, category)
|
# dir menu entry, description, category)
|
||||||
texinfo_documents = [
|
texinfo_documents = [
|
||||||
('index', 'watcher', u'Watcher Documentation',
|
('index', 'watcher', 'Watcher Documentation',
|
||||||
u'Watcher developers', 'watcher', 'One line description of project.',
|
'Watcher developers', 'watcher', 'One line description of project.',
|
||||||
'Miscellaneous'),
|
'Miscellaneous'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ Contents:
|
|||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
unreleased
|
unreleased
|
||||||
|
2023.1
|
||||||
|
zed
|
||||||
|
yoga
|
||||||
xena
|
xena
|
||||||
wallaby
|
wallaby
|
||||||
victoria
|
victoria
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
# Andi Chandler <andi@gowling.com>, 2017. #zanata
|
# Andi Chandler <andi@gowling.com>, 2017. #zanata
|
||||||
# Andi Chandler <andi@gowling.com>, 2018. #zanata
|
# Andi Chandler <andi@gowling.com>, 2018. #zanata
|
||||||
# Andi Chandler <andi@gowling.com>, 2020. #zanata
|
# Andi Chandler <andi@gowling.com>, 2020. #zanata
|
||||||
|
# Andi Chandler <andi@gowling.com>, 2022. #zanata
|
||||||
|
# Andi Chandler <andi@gowling.com>, 2023. #zanata
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: python-watcher\n"
|
"Project-Id-Version: python-watcher\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2020-10-27 04:13+0000\n"
|
"POT-Creation-Date: 2023-08-14 03:05+0000\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"PO-Revision-Date: 2020-10-28 11:13+0000\n"
|
"PO-Revision-Date: 2023-06-21 07:54+0000\n"
|
||||||
"Last-Translator: Andi Chandler <andi@gowling.com>\n"
|
"Last-Translator: Andi Chandler <andi@gowling.com>\n"
|
||||||
"Language-Team: English (United Kingdom)\n"
|
"Language-Team: English (United Kingdom)\n"
|
||||||
"Language: en_GB\n"
|
"Language: en_GB\n"
|
||||||
@@ -58,12 +60,18 @@ msgstr "1.9.0"
|
|||||||
msgid "2.0.0"
|
msgid "2.0.0"
|
||||||
msgstr "2.0.0"
|
msgstr "2.0.0"
|
||||||
|
|
||||||
|
msgid "2023.1 Series Release Notes"
|
||||||
|
msgstr "2023.1 Series Release Notes"
|
||||||
|
|
||||||
msgid "3.0.0"
|
msgid "3.0.0"
|
||||||
msgstr "3.0.0"
|
msgstr "3.0.0"
|
||||||
|
|
||||||
msgid "4.0.0"
|
msgid "4.0.0"
|
||||||
msgstr "4.0.0"
|
msgstr "4.0.0"
|
||||||
|
|
||||||
|
msgid "6.0.0"
|
||||||
|
msgstr "6.0.0"
|
||||||
|
|
||||||
msgid "A ``watcher-status upgrade check`` has been added for this."
|
msgid "A ``watcher-status upgrade check`` has been added for this."
|
||||||
msgstr "A ``watcher-status upgrade check`` has been added for this."
|
msgstr "A ``watcher-status upgrade check`` has been added for this."
|
||||||
|
|
||||||
@@ -744,6 +752,23 @@ msgstr ""
|
|||||||
"The configuration options for query retries in `[gnocchi_client]` are "
|
"The configuration options for query retries in `[gnocchi_client]` are "
|
||||||
"deprecated and the option in `[watcher_datasources]` should now be used."
|
"deprecated and the option in `[watcher_datasources]` should now be used."
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"The default value of ``[oslo_policy] policy_file`` config option has been "
|
||||||
|
"changed from ``policy.json`` to ``policy.yaml``. Operators who are utilizing "
|
||||||
|
"customized or previously generated static policy JSON files (which are not "
|
||||||
|
"needed by default), should generate new policy files or convert them in YAML "
|
||||||
|
"format. Use the `oslopolicy-convert-json-to-yaml <https://docs.openstack.org/"
|
||||||
|
"oslo.policy/latest/cli/oslopolicy-convert-json-to-yaml.html>`_ tool to "
|
||||||
|
"convert a JSON to YAML formatted policy file in backward compatible way."
|
||||||
|
msgstr ""
|
||||||
|
"The default value of ``[oslo_policy] policy_file`` config option has been "
|
||||||
|
"changed from ``policy.json`` to ``policy.yaml``. Operators who are utilizing "
|
||||||
|
"customized or previously generated static policy JSON files (which are not "
|
||||||
|
"needed by default), should generate new policy files or convert them in YAML "
|
||||||
|
"format. Use the `oslopolicy-convert-json-to-yaml <https://docs.openstack.org/"
|
||||||
|
"oslo.policy/latest/cli/oslopolicy-convert-json-to-yaml.html>`_ tool to "
|
||||||
|
"convert a JSON to YAML formatted policy file in backward compatible way."
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"The graph model describes how VMs are associated to compute hosts. This "
|
"The graph model describes how VMs are associated to compute hosts. This "
|
||||||
"allows for seeing relationships upfront between the entities and hence can "
|
"allows for seeing relationships upfront between the entities and hence can "
|
||||||
@@ -799,6 +824,21 @@ msgstr "Train Series Release Notes"
|
|||||||
msgid "Upgrade Notes"
|
msgid "Upgrade Notes"
|
||||||
msgstr "Upgrade Notes"
|
msgstr "Upgrade Notes"
|
||||||
|
|
||||||
|
msgid ""
|
||||||
|
"Use of JSON policy files was deprecated by the ``oslo.policy`` library "
|
||||||
|
"during the Victoria development cycle. As a result, this deprecation is "
|
||||||
|
"being noted in the Wallaby cycle with an anticipated future removal of "
|
||||||
|
"support by ``oslo.policy``. As such operators will need to convert to YAML "
|
||||||
|
"policy files. Please see the upgrade notes for details on migration of any "
|
||||||
|
"custom policy files."
|
||||||
|
msgstr ""
|
||||||
|
"Use of JSON policy files was deprecated by the ``oslo.policy`` library "
|
||||||
|
"during the Victoria development cycle. As a result, this deprecation is "
|
||||||
|
"being noted in the Wallaby cycle with an anticipated future removal of "
|
||||||
|
"support by ``oslo.policy``. As such operators will need to convert to YAML "
|
||||||
|
"policy files. Please see the upgrade notes for details on migration of any "
|
||||||
|
"custom policy files."
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Using ``watcher/api/app.wsgi`` script is deprecated and it will be removed "
|
"Using ``watcher/api/app.wsgi`` script is deprecated and it will be removed "
|
||||||
"in U release. Please switch to automatically generated ``watcher-api-wsgi`` "
|
"in U release. Please switch to automatically generated ``watcher-api-wsgi`` "
|
||||||
@@ -814,6 +854,9 @@ msgstr "Ussuri Series Release Notes"
|
|||||||
msgid "Victoria Series Release Notes"
|
msgid "Victoria Series Release Notes"
|
||||||
msgstr "Victoria Series Release Notes"
|
msgstr "Victoria Series Release Notes"
|
||||||
|
|
||||||
|
msgid "Wallaby Series Release Notes"
|
||||||
|
msgstr "Wallaby Series Release Notes"
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Watcher can continuously optimize the OpenStack cloud for a specific "
|
"Watcher can continuously optimize the OpenStack cloud for a specific "
|
||||||
"strategy or goal by triggering an audit periodically which generates an "
|
"strategy or goal by triggering an audit periodically which generates an "
|
||||||
@@ -924,6 +967,15 @@ msgstr "We also add some new properties:"
|
|||||||
msgid "Welcome to watcher's Release Notes documentation!"
|
msgid "Welcome to watcher's Release Notes documentation!"
|
||||||
msgstr "Welcome to watcher's Release Notes documentation!"
|
msgstr "Welcome to watcher's Release Notes documentation!"
|
||||||
|
|
||||||
|
msgid "Xena Series Release Notes"
|
||||||
|
msgstr "Xena Series Release Notes"
|
||||||
|
|
||||||
|
msgid "Yoga Series Release Notes"
|
||||||
|
msgstr "Yoga Series Release Notes"
|
||||||
|
|
||||||
|
msgid "Zed Series Release Notes"
|
||||||
|
msgstr "Zed Series Release Notes"
|
||||||
|
|
||||||
msgid "``[watcher_datasources] datasources = gnocchi,monasca,ceilometer``"
|
msgid "``[watcher_datasources] datasources = gnocchi,monasca,ceilometer``"
|
||||||
msgstr "``[watcher_datasources] datasources = gnocchi,monasca,ceilometer``"
|
msgstr "``[watcher_datasources] datasources = gnocchi,monasca,ceilometer``"
|
||||||
|
|
||||||
|
|||||||
6
releasenotes/source/yoga.rst
Normal file
6
releasenotes/source/yoga.rst
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
=========================
|
||||||
|
Yoga Series Release Notes
|
||||||
|
=========================
|
||||||
|
|
||||||
|
.. release-notes::
|
||||||
|
:branch: stable/yoga
|
||||||
6
releasenotes/source/zed.rst
Normal file
6
releasenotes/source/zed.rst
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
========================
|
||||||
|
Zed Series Release Notes
|
||||||
|
========================
|
||||||
|
|
||||||
|
.. release-notes::
|
||||||
|
:branch: stable/zed
|
||||||
@@ -17,7 +17,7 @@ oslo.context>=2.21.0 # Apache-2.0
|
|||||||
oslo.db>=4.44.0 # Apache-2.0
|
oslo.db>=4.44.0 # Apache-2.0
|
||||||
oslo.i18n>=3.20.0 # Apache-2.0
|
oslo.i18n>=3.20.0 # Apache-2.0
|
||||||
oslo.log>=3.37.0 # Apache-2.0
|
oslo.log>=3.37.0 # Apache-2.0
|
||||||
oslo.messaging>=8.1.2 # Apache-2.0
|
oslo.messaging>=14.1.0 # Apache-2.0
|
||||||
oslo.policy>=3.6.0 # Apache-2.0
|
oslo.policy>=3.6.0 # Apache-2.0
|
||||||
oslo.reports>=1.27.0 # Apache-2.0
|
oslo.reports>=1.27.0 # Apache-2.0
|
||||||
oslo.serialization>=2.25.0 # Apache-2.0
|
oslo.serialization>=2.25.0 # Apache-2.0
|
||||||
|
|||||||
@@ -12,3 +12,4 @@ testtools>=2.3.0 # MIT
|
|||||||
stestr>=2.0.0 # Apache-2.0
|
stestr>=2.0.0 # Apache-2.0
|
||||||
os-api-ref>=1.4.0 # Apache-2.0
|
os-api-ref>=1.4.0 # Apache-2.0
|
||||||
bandit>=1.6.0 # Apache-2.0
|
bandit>=1.6.0 # Apache-2.0
|
||||||
|
WebTest>=2.0.27 # MIT
|
||||||
13
tox.ini
13
tox.ini
@@ -1,7 +1,6 @@
|
|||||||
[tox]
|
[tox]
|
||||||
minversion = 3.18.0
|
minversion = 3.18.0
|
||||||
envlist = py3,pep8
|
envlist = py3,pep8
|
||||||
skipsdist = True
|
|
||||||
ignore_basepython_conflict = True
|
ignore_basepython_conflict = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
@@ -9,7 +8,7 @@ basepython = python3
|
|||||||
usedevelop = True
|
usedevelop = True
|
||||||
allowlist_externals = find
|
allowlist_externals = find
|
||||||
rm
|
rm
|
||||||
install_command = pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
|
install_command = pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2023.2} {opts} {packages}
|
||||||
setenv =
|
setenv =
|
||||||
VIRTUAL_ENV={envdir}
|
VIRTUAL_ENV={envdir}
|
||||||
deps =
|
deps =
|
||||||
@@ -19,13 +18,19 @@ commands =
|
|||||||
rm -f .testrepository/times.dbm
|
rm -f .testrepository/times.dbm
|
||||||
find . -type f -name "*.py[c|o]" -delete
|
find . -type f -name "*.py[c|o]" -delete
|
||||||
stestr run {posargs}
|
stestr run {posargs}
|
||||||
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
passenv =
|
||||||
|
http_proxy
|
||||||
|
HTTP_PROXY
|
||||||
|
https_proxy
|
||||||
|
HTTPS_PROXY
|
||||||
|
no_proxy
|
||||||
|
NO_PROXY
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
commands =
|
commands =
|
||||||
doc8 doc/source/ CONTRIBUTING.rst HACKING.rst README.rst
|
doc8 doc/source/ CONTRIBUTING.rst HACKING.rst README.rst
|
||||||
flake8
|
flake8
|
||||||
bandit -r watcher -x watcher/tests/* -n5 -ll -s B320
|
#bandit -r watcher -x watcher/tests/* -n5 -ll -s B320
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
setenv = PYTHONHASHSEED=0
|
setenv = PYTHONHASHSEED=0
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class RequestContextSerializer(messaging.Serializer):
|
|||||||
def get_client(target, version_cap=None, serializer=None):
|
def get_client(target, version_cap=None, serializer=None):
|
||||||
assert TRANSPORT is not None
|
assert TRANSPORT is not None
|
||||||
serializer = RequestContextSerializer(serializer)
|
serializer = RequestContextSerializer(serializer)
|
||||||
return messaging.RPCClient(
|
return messaging.get_rpc_client(
|
||||||
TRANSPORT,
|
TRANSPORT,
|
||||||
target,
|
target,
|
||||||
version_cap=version_cap,
|
version_cap=version_cap,
|
||||||
|
|||||||
@@ -134,7 +134,13 @@ GRAFANA_CLIENT_OPTS = [
|
|||||||
"InfluxDB this will be the retention period. "
|
"InfluxDB this will be the retention period. "
|
||||||
"These queries will need to be constructed using tools "
|
"These queries will need to be constructed using tools "
|
||||||
"such as Postman. Example: SELECT cpu FROM {4}."
|
"such as Postman. Example: SELECT cpu FROM {4}."
|
||||||
"cpu_percent WHERE host == '{1}' AND time > now()-{2}s")]
|
"cpu_percent WHERE host == '{1}' AND time > now()-{2}s"),
|
||||||
|
cfg.IntOpt('http_timeout',
|
||||||
|
min=0,
|
||||||
|
default=60,
|
||||||
|
mutable=True,
|
||||||
|
help='Timeout for Grafana request')
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def register_opts(conf):
|
def register_opts(conf):
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ Create Date: 2017-03-24 11:21:29.036532
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
from alembic import op
|
from alembic import op
|
||||||
|
from sqlalchemy import inspect
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
||||||
from watcher.db.sqlalchemy import models
|
from watcher.db.sqlalchemy import models
|
||||||
@@ -14,8 +15,17 @@ from watcher.db.sqlalchemy import models
|
|||||||
revision = '0f6042416884'
|
revision = '0f6042416884'
|
||||||
down_revision = '001'
|
down_revision = '001'
|
||||||
|
|
||||||
|
def _table_exists(table_name):
|
||||||
|
bind = op.get_context().bind
|
||||||
|
insp = inspect(bind)
|
||||||
|
names = insp.get_table_names()
|
||||||
|
return any(t == table_name for t in names)
|
||||||
|
|
||||||
|
|
||||||
def upgrade():
|
def upgrade():
|
||||||
|
if _table_exists('apscheduler_jobs'):
|
||||||
|
return
|
||||||
|
|
||||||
op.create_table(
|
op.create_table(
|
||||||
'apscheduler_jobs',
|
'apscheduler_jobs',
|
||||||
sa.Column('id', sa.Unicode(191, _warn_on_bytestring=False),
|
sa.Column('id', sa.Unicode(191, _warn_on_bytestring=False),
|
||||||
|
|||||||
@@ -44,7 +44,11 @@ _FACADE = None
|
|||||||
def _create_facade_lazily():
|
def _create_facade_lazily():
|
||||||
global _FACADE
|
global _FACADE
|
||||||
if _FACADE is None:
|
if _FACADE is None:
|
||||||
_FACADE = db_session.EngineFacade.from_config(CONF)
|
# FIXME(amoralej): Remove autocommit=True (and ideally use of
|
||||||
|
# LegacyEngineFacade) asap since it's not compatible with SQLAlchemy
|
||||||
|
# 2.0.
|
||||||
|
_FACADE = db_session.EngineFacade.from_config(CONF,
|
||||||
|
autocommit=True)
|
||||||
return _FACADE
|
return _FACADE
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class GnocchiHelper(base.DataSourceBase):
|
|||||||
host_inlet_temp='hardware.ipmi.node.temperature',
|
host_inlet_temp='hardware.ipmi.node.temperature',
|
||||||
host_airflow='hardware.ipmi.node.airflow',
|
host_airflow='hardware.ipmi.node.airflow',
|
||||||
host_power='hardware.ipmi.node.power',
|
host_power='hardware.ipmi.node.power',
|
||||||
instance_cpu_usage='cpu_util',
|
instance_cpu_usage='cpu',
|
||||||
instance_ram_usage='memory.resident',
|
instance_ram_usage='memory.resident',
|
||||||
instance_ram_allocated='memory',
|
instance_ram_allocated='memory',
|
||||||
instance_l3_cache_usage='cpu_l3_cache',
|
instance_l3_cache_usage='cpu_l3_cache',
|
||||||
@@ -93,6 +93,25 @@ class GnocchiHelper(base.DataSourceBase):
|
|||||||
|
|
||||||
resource_id = resources[0]['id']
|
resource_id = resources[0]['id']
|
||||||
|
|
||||||
|
if meter_name == "instance_cpu_usage":
|
||||||
|
if resource_type != "instance":
|
||||||
|
LOG.warning("Unsupported resource type for metric "
|
||||||
|
"'instance_cpu_usage': ", resource_type)
|
||||||
|
return
|
||||||
|
|
||||||
|
# The "cpu_util" gauge (percentage) metric has been removed.
|
||||||
|
# We're going to obtain the same result by using the rate of change
|
||||||
|
# aggregate operation.
|
||||||
|
if aggregate not in ("mean", "rate:mean"):
|
||||||
|
LOG.warning("Unsupported aggregate for instance_cpu_usage "
|
||||||
|
"metric: %s. "
|
||||||
|
"Supported aggregates: mean, rate:mean ",
|
||||||
|
aggregate)
|
||||||
|
return
|
||||||
|
|
||||||
|
# TODO(lpetrut): consider supporting other aggregates.
|
||||||
|
aggregate = "rate:mean"
|
||||||
|
|
||||||
raw_kwargs = dict(
|
raw_kwargs = dict(
|
||||||
metric=meter,
|
metric=meter,
|
||||||
start=start_time,
|
start=start_time,
|
||||||
@@ -117,6 +136,17 @@ class GnocchiHelper(base.DataSourceBase):
|
|||||||
# Airflow from hardware.ipmi.node.airflow is reported as
|
# Airflow from hardware.ipmi.node.airflow is reported as
|
||||||
# 1/10 th of actual CFM
|
# 1/10 th of actual CFM
|
||||||
return_value *= 10
|
return_value *= 10
|
||||||
|
if meter_name == "instance_cpu_usage":
|
||||||
|
# "rate:mean" can return negative values for migrated vms.
|
||||||
|
return_value = max(0, return_value)
|
||||||
|
|
||||||
|
# We're converting the cumulative cpu time (ns) to cpu usage
|
||||||
|
# percentage.
|
||||||
|
vcpus = resource.vcpus
|
||||||
|
if not vcpus:
|
||||||
|
LOG.warning("instance vcpu count not set, assuming 1")
|
||||||
|
vcpus = 1
|
||||||
|
return_value *= 100 / (granularity * 10e+8) / vcpus
|
||||||
|
|
||||||
return return_value
|
return return_value
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,8 @@ class GrafanaHelper(base.DataSourceBase):
|
|||||||
raise exception.DataSourceNotAvailable(self.NAME)
|
raise exception.DataSourceNotAvailable(self.NAME)
|
||||||
|
|
||||||
resp = requests.get(self._base_url + str(project_id) + '/query',
|
resp = requests.get(self._base_url + str(project_id) + '/query',
|
||||||
params=params, headers=self._headers)
|
params=params, headers=self._headers,
|
||||||
|
timeout=CONF.grafana_client.http_timeout)
|
||||||
if resp.status_code == HTTPStatus.OK:
|
if resp.status_code == HTTPStatus.OK:
|
||||||
return resp
|
return resp
|
||||||
elif resp.status_code == HTTPStatus.BAD_REQUEST:
|
elif resp.status_code == HTTPStatus.BAD_REQUEST:
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class NovaClusterDataModelCollector(base.BaseClusterDataModelCollector):
|
|||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{"$ref": HOST_AGGREGATES + "id"},
|
{"$ref": HOST_AGGREGATES + "host_aggr_id"},
|
||||||
{"$ref": HOST_AGGREGATES + "name"},
|
{"$ref": HOST_AGGREGATES + "name"},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -98,7 +98,8 @@ class NovaClusterDataModelCollector(base.BaseClusterDataModelCollector):
|
|||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{"$ref": HOST_AGGREGATES + "id"},
|
{"$ref":
|
||||||
|
HOST_AGGREGATES + "host_aggr_id"},
|
||||||
{"$ref": HOST_AGGREGATES + "name"},
|
{"$ref": HOST_AGGREGATES + "name"},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -129,7 +130,7 @@ class NovaClusterDataModelCollector(base.BaseClusterDataModelCollector):
|
|||||||
"additionalProperties": False
|
"additionalProperties": False
|
||||||
},
|
},
|
||||||
"host_aggregates": {
|
"host_aggregates": {
|
||||||
"id": {
|
"host_aggr_id": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
|
|||||||
@@ -252,9 +252,6 @@ class BaseStrategy(loadable.Loadable, metaclass=abc.ABCMeta):
|
|||||||
if not self.compute_model:
|
if not self.compute_model:
|
||||||
raise exception.ClusterStateNotDefined()
|
raise exception.ClusterStateNotDefined()
|
||||||
|
|
||||||
if self.compute_model.stale:
|
|
||||||
raise exception.ClusterStateStale()
|
|
||||||
|
|
||||||
LOG.debug(self.compute_model.to_string())
|
LOG.debug(self.compute_model.to_string())
|
||||||
|
|
||||||
def execute(self, audit=None):
|
def execute(self, audit=None):
|
||||||
|
|||||||
@@ -206,13 +206,13 @@ class SavingEnergy(base.SavingEnergyBaseStrategy):
|
|||||||
for node in random.sample(self.free_poweron_node_pool,
|
for node in random.sample(self.free_poweron_node_pool,
|
||||||
(len_poweron - need_poweron)):
|
(len_poweron - need_poweron)):
|
||||||
self.add_action_poweronoff_node(node, 'off')
|
self.add_action_poweronoff_node(node, 'off')
|
||||||
LOG.debug("power off %s", node.uuid)
|
LOG.info("power off %s", node.uuid)
|
||||||
elif len_poweron < need_poweron:
|
elif len_poweron < need_poweron:
|
||||||
diff = need_poweron - len_poweron
|
diff = need_poweron - len_poweron
|
||||||
for node in random.sample(self.free_poweroff_node_pool,
|
for node in random.sample(self.free_poweroff_node_pool,
|
||||||
min(len_poweroff, diff)):
|
min(len_poweroff, diff)):
|
||||||
self.add_action_poweronoff_node(node, 'on')
|
self.add_action_poweronoff_node(node, 'on')
|
||||||
LOG.debug("power on %s", node.uuid)
|
LOG.info("power on %s", node.uuid)
|
||||||
|
|
||||||
def pre_execute(self):
|
def pre_execute(self):
|
||||||
self._pre_execute()
|
self._pre_execute()
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ class WorkloadBalance(base.WorkloadStabilizationBaseStrategy):
|
|||||||
self.threshold)
|
self.threshold)
|
||||||
return self.solution
|
return self.solution
|
||||||
|
|
||||||
# choose the server with largest cpu_util
|
# choose the server with largest cpu usage
|
||||||
source_nodes = sorted(source_nodes,
|
source_nodes = sorted(source_nodes,
|
||||||
reverse=True,
|
reverse=True,
|
||||||
key=lambda x: (x[self._meter]))
|
key=lambda x: (x[self._meter]))
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
# Andi Chandler <andi@gowling.com>, 2017. #zanata
|
# Andi Chandler <andi@gowling.com>, 2017. #zanata
|
||||||
# Andi Chandler <andi@gowling.com>, 2018. #zanata
|
# Andi Chandler <andi@gowling.com>, 2018. #zanata
|
||||||
# Andi Chandler <andi@gowling.com>, 2020. #zanata
|
# Andi Chandler <andi@gowling.com>, 2020. #zanata
|
||||||
|
# Andi Chandler <andi@gowling.com>, 2022. #zanata
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: watcher VERSION\n"
|
"Project-Id-Version: watcher VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n"
|
"Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n"
|
||||||
"POT-Creation-Date: 2020-10-27 04:14+0000\n"
|
"POT-Creation-Date: 2022-08-29 03:03+0000\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"PO-Revision-Date: 2020-10-28 11:02+0000\n"
|
"PO-Revision-Date: 2022-05-31 08:38+0000\n"
|
||||||
"Last-Translator: Andi Chandler <andi@gowling.com>\n"
|
"Last-Translator: Andi Chandler <andi@gowling.com>\n"
|
||||||
"Language-Team: English (United Kingdom)\n"
|
"Language-Team: English (United Kingdom)\n"
|
||||||
"Language: en_GB\n"
|
"Language: en_GB\n"
|
||||||
@@ -507,6 +508,9 @@ msgstr ""
|
|||||||
msgid "Plugins"
|
msgid "Plugins"
|
||||||
msgstr "Plugins"
|
msgstr "Plugins"
|
||||||
|
|
||||||
|
msgid "Policy File JSON to YAML Migration"
|
||||||
|
msgstr "Policy File JSON to YAML Migration"
|
||||||
|
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Policy doesn't allow %(action)s to be performed."
|
msgid "Policy doesn't allow %(action)s to be performed."
|
||||||
msgstr "Policy doesn't allow %(action)s to be performed."
|
msgstr "Policy doesn't allow %(action)s to be performed."
|
||||||
|
|||||||
@@ -80,13 +80,13 @@ class TestService(base.TestCase):
|
|||||||
super(TestService, self).setUp()
|
super(TestService, self).setUp()
|
||||||
|
|
||||||
@mock.patch.object(om.rpc.server, "RPCServer")
|
@mock.patch.object(om.rpc.server, "RPCServer")
|
||||||
def test_start(self, m_handler):
|
def _test_start(self, m_handler):
|
||||||
dummy_service = service.Service(DummyManager)
|
dummy_service = service.Service(DummyManager)
|
||||||
dummy_service.start()
|
dummy_service.start()
|
||||||
self.assertEqual(1, m_handler.call_count)
|
self.assertEqual(1, m_handler.call_count)
|
||||||
|
|
||||||
@mock.patch.object(om.rpc.server, "RPCServer")
|
@mock.patch.object(om.rpc.server, "RPCServer")
|
||||||
def test_stop(self, m_handler):
|
def _test_stop(self, m_handler):
|
||||||
dummy_service = service.Service(DummyManager)
|
dummy_service = service.Service(DummyManager)
|
||||||
dummy_service.stop()
|
dummy_service.stop()
|
||||||
self.assertEqual(1, m_handler.call_count)
|
self.assertEqual(1, m_handler.call_count)
|
||||||
|
|||||||
@@ -40,17 +40,25 @@ class TestGnocchiHelper(base.BaseTestCase):
|
|||||||
self.addCleanup(stat_agg_patcher.stop)
|
self.addCleanup(stat_agg_patcher.stop)
|
||||||
|
|
||||||
def test_gnocchi_statistic_aggregation(self, mock_gnocchi):
|
def test_gnocchi_statistic_aggregation(self, mock_gnocchi):
|
||||||
|
vcpus = 2
|
||||||
|
mock_instance = mock.Mock(
|
||||||
|
id='16a86790-327a-45f9-bc82-45839f062fdc',
|
||||||
|
vcpus=vcpus)
|
||||||
|
|
||||||
gnocchi = mock.MagicMock()
|
gnocchi = mock.MagicMock()
|
||||||
|
# cpu time rate of change (ns)
|
||||||
|
mock_rate_measure = 360 * 10e+8 * vcpus * 5.5 / 100
|
||||||
expected_result = 5.5
|
expected_result = 5.5
|
||||||
|
|
||||||
expected_measures = [["2017-02-02T09:00:00.000000", 360, 5.5]]
|
expected_measures = [
|
||||||
|
["2017-02-02T09:00:00.000000", 360, mock_rate_measure]]
|
||||||
|
|
||||||
gnocchi.metric.get_measures.return_value = expected_measures
|
gnocchi.metric.get_measures.return_value = expected_measures
|
||||||
mock_gnocchi.return_value = gnocchi
|
mock_gnocchi.return_value = gnocchi
|
||||||
|
|
||||||
helper = gnocchi_helper.GnocchiHelper()
|
helper = gnocchi_helper.GnocchiHelper()
|
||||||
result = helper.statistic_aggregation(
|
result = helper.statistic_aggregation(
|
||||||
resource=mock.Mock(id='16a86790-327a-45f9-bc82-45839f062fdc'),
|
resource=mock_instance,
|
||||||
resource_type='instance',
|
resource_type='instance',
|
||||||
meter_name='instance_cpu_usage',
|
meter_name='instance_cpu_usage',
|
||||||
period=300,
|
period=300,
|
||||||
@@ -59,6 +67,14 @@ class TestGnocchiHelper(base.BaseTestCase):
|
|||||||
)
|
)
|
||||||
self.assertEqual(expected_result, result)
|
self.assertEqual(expected_result, result)
|
||||||
|
|
||||||
|
gnocchi.metric.get_measures.assert_called_once_with(
|
||||||
|
metric="cpu",
|
||||||
|
start=mock.ANY,
|
||||||
|
stop=mock.ANY,
|
||||||
|
resource_id=mock_instance.uuid,
|
||||||
|
granularity=360,
|
||||||
|
aggregation="rate:mean")
|
||||||
|
|
||||||
def test_gnocchi_statistic_series(self, mock_gnocchi):
|
def test_gnocchi_statistic_series(self, mock_gnocchi):
|
||||||
gnocchi = mock.MagicMock()
|
gnocchi = mock.MagicMock()
|
||||||
expected_result = {
|
expected_result = {
|
||||||
|
|||||||
Reference in New Issue
Block a user