python-watcher 11.0.0__py3-none-any.whl → 11.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. {python_watcher-11.0.0.dist-info → python_watcher-11.0.1.dist-info}/AUTHORS +1 -0
  2. {python_watcher-11.0.0.dist-info → python_watcher-11.0.1.dist-info}/METADATA +47 -49
  3. {python_watcher-11.0.0.dist-info → python_watcher-11.0.1.dist-info}/RECORD +17 -17
  4. {python_watcher-11.0.0.dist-info → python_watcher-11.0.1.dist-info}/WHEEL +1 -1
  5. {python_watcher-11.0.0.dist-info → python_watcher-11.0.1.dist-info}/entry_points.txt +0 -1
  6. python_watcher-11.0.1.dist-info/pbr.json +1 -0
  7. watcher/decision_engine/datasources/gnocchi.py +31 -1
  8. watcher/decision_engine/model/collector/nova.py +4 -3
  9. watcher/decision_engine/strategy/strategies/workload_balance.py +1 -1
  10. watcher/tests/decision_engine/datasources/test_gnocchi_helper.py +18 -2
  11. python_watcher-11.0.0.dist-info/pbr.json +0 -1
  12. {python_watcher-11.0.0.data → python_watcher-11.0.1.data}/data/etc/apache2/watcher +0 -0
  13. {python_watcher-11.0.0.data → python_watcher-11.0.1.data}/data/etc/watcher/README-watcher.conf.txt +0 -0
  14. {python_watcher-11.0.0.data → python_watcher-11.0.1.data}/data/etc/watcher/oslo-config-generator/watcher.conf +0 -0
  15. {python_watcher-11.0.0.data → python_watcher-11.0.1.data}/data/etc/watcher/oslo-policy-generator/watcher-policy-generator.conf +0 -0
  16. {python_watcher-11.0.0.data → python_watcher-11.0.1.data}/scripts/watcher-api-wsgi +0 -0
  17. {python_watcher-11.0.0.dist-info → python_watcher-11.0.1.dist-info}/LICENSE +0 -0
  18. {python_watcher-11.0.0.dist-info → python_watcher-11.0.1.dist-info}/top_level.txt +0 -0
@@ -57,6 +57,7 @@ Lance Bragstad <lbragstad@gmail.com>
57
57
  Larry Rensing <lr699s@att.com>
58
58
  LiXiangyu <lixiangyu@cmss.chinamobile.com>
59
59
  Lin Yang <lin.a.yang@intel.com>
60
+ Lucian Petrut <lpetrut@cloudbasesolutions.com>
60
61
  Luigi Toscano <ltoscano@redhat.com>
61
62
  Luong Anh Tuan <tuanla@vn.fujitsu.com>
62
63
  M V P Nitesh <m.nitesh@nectechnologies.in>
@@ -1,12 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-watcher
3
- Version: 11.0.0
3
+ Version: 11.0.1
4
4
  Summary: OpenStack Watcher provides a flexible and scalable resource optimization service for multi-tenant OpenStack-based clouds.
5
5
  Home-page: https://docs.openstack.org/watcher/latest/
6
6
  Author: OpenStack
7
7
  Author-email: openstack-discuss@lists.openstack.org
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
8
  Classifier: Environment :: OpenStack
11
9
  Classifier: Intended Audience :: Information Technology
12
10
  Classifier: Intended Audience :: System Administrators
@@ -20,50 +18,52 @@ Classifier: Programming Language :: Python :: 3.6
20
18
  Classifier: Programming Language :: Python :: 3.7
21
19
  Classifier: Programming Language :: Python :: 3.8
22
20
  Requires-Python: >=3.6
23
- Requires-Dist: PasteDeploy (>=1.5.2)
24
- Requires-Dist: PrettyTable (>=0.7.2)
25
- Requires-Dist: SQLAlchemy (>=1.2.5)
26
- Requires-Dist: WSME (>=0.9.2)
27
- Requires-Dist: WebOb (>=1.8.5)
28
- Requires-Dist: apscheduler (>=3.5.1)
29
- Requires-Dist: croniter (>=0.3.20)
30
- Requires-Dist: futurist (>=1.8.0)
31
- Requires-Dist: gnocchiclient (>=7.0.1)
32
- Requires-Dist: jsonpatch (>=1.21)
33
- Requires-Dist: jsonschema (>=3.2.0)
34
- Requires-Dist: keystoneauth1 (>=3.4.0)
35
- Requires-Dist: keystonemiddleware (>=4.21.0)
36
- Requires-Dist: lxml (>=4.5.1)
37
- Requires-Dist: microversion-parse (>=0.2.1)
38
- Requires-Dist: networkx (>=2.4)
39
- Requires-Dist: os-resource-classes (>=0.4.0)
40
- Requires-Dist: oslo.cache (>=1.29.0)
41
- Requires-Dist: oslo.concurrency (>=3.26.0)
42
- Requires-Dist: oslo.config (>=6.8.0)
43
- Requires-Dist: oslo.context (>=2.21.0)
44
- Requires-Dist: oslo.db (>=4.44.0)
45
- Requires-Dist: oslo.i18n (>=3.20.0)
46
- Requires-Dist: oslo.log (>=3.37.0)
47
- Requires-Dist: oslo.messaging (>=14.1.0)
48
- Requires-Dist: oslo.policy (>=3.6.0)
49
- Requires-Dist: oslo.reports (>=1.27.0)
50
- Requires-Dist: oslo.serialization (>=2.25.0)
51
- Requires-Dist: oslo.service (>=1.30.0)
52
- Requires-Dist: oslo.upgradecheck (>=1.3.0)
53
- Requires-Dist: oslo.utils (>=3.36.0)
54
- Requires-Dist: oslo.versionedobjects (>=1.32.0)
55
- Requires-Dist: pbr (>=3.1.1)
56
- Requires-Dist: pecan (>=1.3.2)
57
- Requires-Dist: python-cinderclient (>=3.5.0)
58
- Requires-Dist: python-glanceclient (>=2.9.1)
59
- Requires-Dist: python-ironicclient (>=2.5.0)
60
- Requires-Dist: python-keystoneclient (>=3.15.0)
61
- Requires-Dist: python-monascaclient (>=1.12.0)
62
- Requires-Dist: python-neutronclient (>=6.7.0)
63
- Requires-Dist: python-novaclient (>=14.1.0)
64
- Requires-Dist: python-openstackclient (>=3.14.0)
65
- Requires-Dist: stevedore (>=1.28.0)
66
- Requires-Dist: taskflow (>=3.8.0)
21
+ License-File: LICENSE
22
+ License-File: AUTHORS
23
+ Requires-Dist: apscheduler >=3.5.1
24
+ Requires-Dist: jsonpatch >=1.21
25
+ Requires-Dist: keystoneauth1 >=3.4.0
26
+ Requires-Dist: jsonschema >=3.2.0
27
+ Requires-Dist: keystonemiddleware >=4.21.0
28
+ Requires-Dist: lxml >=4.5.1
29
+ Requires-Dist: croniter >=0.3.20
30
+ Requires-Dist: os-resource-classes >=0.4.0
31
+ Requires-Dist: oslo.concurrency >=3.26.0
32
+ Requires-Dist: oslo.cache >=1.29.0
33
+ Requires-Dist: oslo.config >=6.8.0
34
+ Requires-Dist: oslo.context >=2.21.0
35
+ Requires-Dist: oslo.db >=4.44.0
36
+ Requires-Dist: oslo.i18n >=3.20.0
37
+ Requires-Dist: oslo.log >=3.37.0
38
+ Requires-Dist: oslo.messaging >=14.1.0
39
+ Requires-Dist: oslo.policy >=3.6.0
40
+ Requires-Dist: oslo.reports >=1.27.0
41
+ Requires-Dist: oslo.serialization >=2.25.0
42
+ Requires-Dist: oslo.service >=1.30.0
43
+ Requires-Dist: oslo.upgradecheck >=1.3.0
44
+ Requires-Dist: oslo.utils >=3.36.0
45
+ Requires-Dist: oslo.versionedobjects >=1.32.0
46
+ Requires-Dist: PasteDeploy >=1.5.2
47
+ Requires-Dist: pbr >=3.1.1
48
+ Requires-Dist: pecan >=1.3.2
49
+ Requires-Dist: PrettyTable >=0.7.2
50
+ Requires-Dist: gnocchiclient >=7.0.1
51
+ Requires-Dist: python-cinderclient >=3.5.0
52
+ Requires-Dist: python-glanceclient >=2.9.1
53
+ Requires-Dist: python-keystoneclient >=3.15.0
54
+ Requires-Dist: python-monascaclient >=1.12.0
55
+ Requires-Dist: python-neutronclient >=6.7.0
56
+ Requires-Dist: python-novaclient >=14.1.0
57
+ Requires-Dist: python-openstackclient >=3.14.0
58
+ Requires-Dist: python-ironicclient >=2.5.0
59
+ Requires-Dist: SQLAlchemy >=1.2.5
60
+ Requires-Dist: stevedore >=1.28.0
61
+ Requires-Dist: taskflow >=3.8.0
62
+ Requires-Dist: WebOb >=1.8.5
63
+ Requires-Dist: WSME >=0.9.2
64
+ Requires-Dist: networkx >=2.4
65
+ Requires-Dist: microversion-parse >=0.2.1
66
+ Requires-Dist: futurist >=1.8.0
67
67
 
68
68
  =======
69
69
  Watcher
@@ -95,5 +95,3 @@ migration, increased energy efficiency and more!
95
95
  * Release notes: https://docs.openstack.org/releasenotes/watcher/
96
96
  * Design specifications: https://specs.openstack.org/openstack/watcher-specs/
97
97
 
98
-
99
-
@@ -1,8 +1,8 @@
1
- python_watcher-11.0.0.data/data/etc/apache2/watcher,sha256=urybYUTb0kAVIvbm4WK5oDfXR82QSK2lyMl4Z9dCz4Q,1190
2
- python_watcher-11.0.0.data/data/etc/watcher/README-watcher.conf.txt,sha256=EIa_sjXDyl1XSg0ovsFwUjqw0euS0N2PYn4HtyBGJME,131
3
- python_watcher-11.0.0.data/data/etc/watcher/oslo-config-generator/watcher.conf,sha256=O7g1DZqgXvbQgkBfot0dR1ar1d-3SBkOU_ZK4Dz7SFc,406
4
- python_watcher-11.0.0.data/data/etc/watcher/oslo-policy-generator/watcher-policy-generator.conf,sha256=ZfIuVdtrj7IZm2BrRQvAW3JOL_kqCiILf-vBmwX3ufw,76
5
- python_watcher-11.0.0.data/scripts/watcher-api-wsgi,sha256=YcIpUO3iRVW6Fu3Md_ooAeHkmJJasG031naMdf8cv2A,1829
1
+ python_watcher-11.0.1.data/data/etc/apache2/watcher,sha256=urybYUTb0kAVIvbm4WK5oDfXR82QSK2lyMl4Z9dCz4Q,1190
2
+ python_watcher-11.0.1.data/data/etc/watcher/README-watcher.conf.txt,sha256=EIa_sjXDyl1XSg0ovsFwUjqw0euS0N2PYn4HtyBGJME,131
3
+ python_watcher-11.0.1.data/data/etc/watcher/oslo-config-generator/watcher.conf,sha256=O7g1DZqgXvbQgkBfot0dR1ar1d-3SBkOU_ZK4Dz7SFc,406
4
+ python_watcher-11.0.1.data/data/etc/watcher/oslo-policy-generator/watcher-policy-generator.conf,sha256=ZfIuVdtrj7IZm2BrRQvAW3JOL_kqCiILf-vBmwX3ufw,76
5
+ python_watcher-11.0.1.data/scripts/watcher-api-wsgi,sha256=YcIpUO3iRVW6Fu3Md_ooAeHkmJJasG031naMdf8cv2A,1829
6
6
  watcher/__init__.py,sha256=Vs2olXPZ_IAV1rukHYRl3ITzYFBNXX9mIUtFXkMWYwg,640
7
7
  watcher/_i18n.py,sha256=-25OcpwjDCiYdFIUJh86S7Sg0fs3wMIIjEreaGUyCyY,1295
8
8
  watcher/version.py,sha256=3bUsLHmwjNgOJ9hfzy5yQ67UGFOriUNFJqyh8lGQazE,760
@@ -166,7 +166,7 @@ watcher/decision_engine/audit/oneshot.py,sha256=hbcAofXAVEjC5HWJpKq8y1AEKuyFjk33
166
166
  watcher/decision_engine/datasources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
167
167
  watcher/decision_engine/datasources/base.py,sha256=SdGgznrux59Dj-9yQ5Su4WdXctC_6RCoWrrD1yt8UaI,9376
168
168
  watcher/decision_engine/datasources/ceilometer.py,sha256=gvURZVkOl-RJ6M_-NAQzMopsrvzlUZZCITsMbQB08Aw,10668
169
- watcher/decision_engine/datasources/gnocchi.py,sha256=E5UJ9NOT1O-5i0KnkZP4sghl69M-nayW57hKqbxoj2c,8788
169
+ watcher/decision_engine/datasources/gnocchi.py,sha256=3z2obHHAo-tFR05UmvNZBdtz3dAYUwK-nuYHky9iBL8,10162
170
170
  watcher/decision_engine/datasources/grafana.py,sha256=tzuswoqx_Yd2cBVR9r3QSH18RjDPIMZDhUETKaXpsp0,10287
171
171
  watcher/decision_engine/datasources/manager.py,sha256=3ovPD5qyzMW8YZeWki7gf6W5iu744fgl0G_XhmeOQqc,5680
172
172
  watcher/decision_engine/datasources/monasca.py,sha256=NtD_OV00uTUS5L3Vg1xJ_R0WhR1rHyueuXUeALMf_aU,6950
@@ -193,7 +193,7 @@ watcher/decision_engine/model/collector/base.py,sha256=t8S6gRd_uaV1GbBuGJLG4AvVw
193
193
  watcher/decision_engine/model/collector/cinder.py,sha256=B743mJca8gQiIu6QG9zaf_du3ihUY6iBv82W1EWoWgk,11683
194
194
  watcher/decision_engine/model/collector/ironic.py,sha256=XMcY9m-zUWyNtANnl_UZ-m1E9PWkt68V90zaRJl5Ba8,4037
195
195
  watcher/decision_engine/model/collector/manager.py,sha256=lEw6-CfyLPBmX97ZaZj7vEu1eHTzQU67oggoQo-KEoI,2327
196
- watcher/decision_engine/model/collector/nova.py,sha256=LRp1pX6HmbmGEpNhRmv0S-K9iynUzUKBgieJSqeQkf4,21542
196
+ watcher/decision_engine/model/collector/nova.py,sha256=pmuxXBGEAgFr4Q_nh4L8uhaItNbvk2S8ulCXiU1HTr0,21616
197
197
  watcher/decision_engine/model/element/__init__.py,sha256=R3XmeW4-ufWnbWruWGLR4SQJP9olmBLADRfyrvP-PaE,1320
198
198
  watcher/decision_engine/model/element/baremetal_resource.py,sha256=WC6CkGhruAXIiynWDsvKbV3VdvDihBMy3YNTa18Q5bg,924
199
199
  watcher/decision_engine/model/element/base.py,sha256=dYgFk33RSoylQbNjCmcwSIb3ZIDccVBpO8FFwqQEPBc,2063
@@ -253,7 +253,7 @@ watcher/decision_engine/strategy/strategies/saving_energy.py,sha256=beRAXqUumnkL
253
253
  watcher/decision_engine/strategy/strategies/storage_capacity_balance.py,sha256=a2C12V3LfISTJLEVFsjvrXWCXmv9knhmU5smzG0N-XE,15669
254
254
  watcher/decision_engine/strategy/strategies/uniform_airflow.py,sha256=8jaW5LGkM9dHb8q9aX_7_hQV-MOXHS2o6jyw9-Z6668,13390
255
255
  watcher/decision_engine/strategy/strategies/vm_workload_consolidation.py,sha256=tFnVwAxuye5jLbt8vYElnQv-Hg5XuQSM-c0QDFJWlnA,23147
256
- watcher/decision_engine/strategy/strategies/workload_balance.py,sha256=hPoX5LbIjITQn43hjLg5Z_rr1a_vVzgJmgbYe5dglgA,14332
256
+ watcher/decision_engine/strategy/strategies/workload_balance.py,sha256=MMJZkfi8kFJDT4Hcp-NTCclN1MMKj02t88OdMinWYnI,14333
257
257
  watcher/decision_engine/strategy/strategies/workload_stabilization.py,sha256=xKnjDeSAkGxvAuUKlxRGuaHVyBjSy-1nFcgI4ni8pnk,24902
258
258
  watcher/decision_engine/strategy/strategies/zone_migration.py,sha256=bNKarllyWVgtNMSIzckV2C4I9IFjQPHfgqdTiOTvEes,33189
259
259
  watcher/hacking/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -382,7 +382,7 @@ watcher/tests/decision_engine/cluster/test_cluster_data_model_collector.py,sha25
382
382
  watcher/tests/decision_engine/cluster/test_nova_cdmc.py,sha256=GtqTL9jfS5w6CvmZQUGYATtVtRcboHbzvasLGeMBkEA,19581
383
383
  watcher/tests/decision_engine/datasources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
384
384
  watcher/tests/decision_engine/datasources/test_base.py,sha256=swGXWVrnypcsVB7eBqhHGqlX0ewkIWheVlX0NRBhMcE,2391
385
- watcher/tests/decision_engine/datasources/test_gnocchi_helper.py,sha256=fyBTVP29n1waFCBvFBNzOMUR5JAtL36dllYLP2WyaJw,8381
385
+ watcher/tests/decision_engine/datasources/test_gnocchi_helper.py,sha256=CqvO0wcvmmBL3rXPW_x9D9RuQcQqNfYkHIlBQmK9z8M,8855
386
386
  watcher/tests/decision_engine/datasources/test_grafana_helper.py,sha256=NVGVlzjAtxOaJLL-1s1V0jETAc5_2QP0Hr0qb4TiEn0,11858
387
387
  watcher/tests/decision_engine/datasources/test_manager.py,sha256=_daZ57iHQI6PWkNHLV7H-B6_Ljk9d9xtzST7IcZ-E1c,6822
388
388
  watcher/tests/decision_engine/datasources/test_monasca_helper.py,sha256=toxxJCRCDgjvnN3wAXzdi6MPOCeMpKRikzXtcg-Oq0k,5697
@@ -529,11 +529,11 @@ watcher/tests/objects/test_scoring_engine.py,sha256=y_crleFQFOUKrqT9tSI1NIP7eEMs
529
529
  watcher/tests/objects/test_service.py,sha256=w8r6qgLJd0Vp3B774BInkWij4qUbMiykisIRSaxiqaA,5100
530
530
  watcher/tests/objects/test_strategy.py,sha256=WoJYFQD0LU7vkUT2MMy1bx3S6eY458aTICjoGRiPccI,7364
531
531
  watcher/tests/objects/utils.py,sha256=WtBFlXWIBRvl1keAjz1GtrkUWppil2pFIA-RngcqA5c,8058
532
- python_watcher-11.0.0.dist-info/AUTHORS,sha256=08XBbMJwOj9SJiMhnpHUCr96nKVexCsUY9OfZss9Y2s,7476
533
- python_watcher-11.0.0.dist-info/LICENSE,sha256=XfKg2H1sVi8OoRxoisUlMqoo10TKvHmU_wU39ks7MyA,10143
534
- python_watcher-11.0.0.dist-info/METADATA,sha256=bFi4zdopmPZDAnVCn5MmzMTTTQbTkORI7rMXzJuv4gI,3876
535
- python_watcher-11.0.0.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
536
- python_watcher-11.0.0.dist-info/entry_points.txt,sha256=FCdhj8D9hluy9jjmwnwmFVumvMeOCv6n_IoOCHF8-WU,4397
537
- python_watcher-11.0.0.dist-info/pbr.json,sha256=EZscyvXwW8ULxvq17Kxh5LgPHkK-5G07mUZahS6SfXA,47
538
- python_watcher-11.0.0.dist-info/top_level.txt,sha256=O2B7Sbzshq5s-tZxb2a7VETvMDiJItSYieAiJ6Jm5yY,8
539
- python_watcher-11.0.0.dist-info/RECORD,,
532
+ python_watcher-11.0.1.dist-info/AUTHORS,sha256=gYRreEvkTWbr4fksqrJEGcezpWZQYUY9Lq26sj1ptw4,7523
533
+ python_watcher-11.0.1.dist-info/LICENSE,sha256=XfKg2H1sVi8OoRxoisUlMqoo10TKvHmU_wU39ks7MyA,10143
534
+ python_watcher-11.0.1.dist-info/METADATA,sha256=NbWbsBGCXcHr6dy4L6BK_CKoZ-57hWQ2CpYz4ugwmNU,3795
535
+ python_watcher-11.0.1.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
536
+ python_watcher-11.0.1.dist-info/entry_points.txt,sha256=PN53WKewBT3McXxlv--kAOX-3NWeJqYVy8wkeCR0orc,4396
537
+ python_watcher-11.0.1.dist-info/pbr.json,sha256=0KtWf3M7hSupFcAuGBe-riFdCEB7bdUyG_DBEyNZ1OA,47
538
+ python_watcher-11.0.1.dist-info/top_level.txt,sha256=O2B7Sbzshq5s-tZxb2a7VETvMDiJItSYieAiJ6Jm5yY,8
539
+ python_watcher-11.0.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.34.2)
2
+ Generator: setuptools (75.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -78,4 +78,3 @@ taskflow = watcher.applier.workflow_engine.default:DefaultWorkFlowEngine
78
78
 
79
79
  [wsgi_scripts]
80
80
  watcher-api-wsgi = watcher.api.wsgi:initialize_wsgi_app
81
-
@@ -0,0 +1 @@
1
+ {"git_version": "090b6959", "is_release": true}
@@ -38,7 +38,7 @@ class GnocchiHelper(base.DataSourceBase):
38
38
  host_inlet_temp='hardware.ipmi.node.temperature',
39
39
  host_airflow='hardware.ipmi.node.airflow',
40
40
  host_power='hardware.ipmi.node.power',
41
- instance_cpu_usage='cpu_util',
41
+ instance_cpu_usage='cpu',
42
42
  instance_ram_usage='memory.resident',
43
43
  instance_ram_allocated='memory',
44
44
  instance_l3_cache_usage='cpu_l3_cache',
@@ -93,6 +93,25 @@ class GnocchiHelper(base.DataSourceBase):
93
93
 
94
94
  resource_id = resources[0]['id']
95
95
 
96
+ if meter_name == "instance_cpu_usage":
97
+ if resource_type != "instance":
98
+ LOG.warning("Unsupported resource type for metric "
99
+ "'instance_cpu_usage': ", resource_type)
100
+ return
101
+
102
+ # The "cpu_util" gauge (percentage) metric has been removed.
103
+ # We're going to obtain the same result by using the rate of change
104
+ # aggregate operation.
105
+ if aggregate not in ("mean", "rate:mean"):
106
+ LOG.warning("Unsupported aggregate for instance_cpu_usage "
107
+ "metric: %s. "
108
+ "Supported aggregates: mean, rate:mean ",
109
+ aggregate)
110
+ return
111
+
112
+ # TODO(lpetrut): consider supporting other aggregates.
113
+ aggregate = "rate:mean"
114
+
96
115
  raw_kwargs = dict(
97
116
  metric=meter,
98
117
  start=start_time,
@@ -117,6 +136,17 @@ class GnocchiHelper(base.DataSourceBase):
117
136
  # Airflow from hardware.ipmi.node.airflow is reported as
118
137
  # 1/10 th of actual CFM
119
138
  return_value *= 10
139
+ if meter_name == "instance_cpu_usage":
140
+ # "rate:mean" can return negative values for migrated vms.
141
+ return_value = max(0, return_value)
142
+
143
+ # We're converting the cumulative cpu time (ns) to cpu usage
144
+ # percentage.
145
+ vcpus = resource.vcpus
146
+ if not vcpus:
147
+ LOG.warning("instance vcpu count not set, assuming 1")
148
+ vcpus = 1
149
+ return_value *= 100 / (granularity * 10e+8) / vcpus
120
150
 
121
151
  return return_value
122
152
 
@@ -48,7 +48,7 @@ class NovaClusterDataModelCollector(base.BaseClusterDataModelCollector):
48
48
  "type": "array",
49
49
  "items": {
50
50
  "anyOf": [
51
- {"$ref": HOST_AGGREGATES + "id"},
51
+ {"$ref": HOST_AGGREGATES + "host_aggr_id"},
52
52
  {"$ref": HOST_AGGREGATES + "name"},
53
53
  ]
54
54
  }
@@ -98,7 +98,8 @@ class NovaClusterDataModelCollector(base.BaseClusterDataModelCollector):
98
98
  "type": "array",
99
99
  "items": {
100
100
  "anyOf": [
101
- {"$ref": HOST_AGGREGATES + "id"},
101
+ {"$ref":
102
+ HOST_AGGREGATES + "host_aggr_id"},
102
103
  {"$ref": HOST_AGGREGATES + "name"},
103
104
  ]
104
105
  }
@@ -129,7 +130,7 @@ class NovaClusterDataModelCollector(base.BaseClusterDataModelCollector):
129
130
  "additionalProperties": False
130
131
  },
131
132
  "host_aggregates": {
132
- "id": {
133
+ "host_aggr_id": {
133
134
  "properties": {
134
135
  "id": {
135
136
  "oneOf": [
@@ -295,7 +295,7 @@ class WorkloadBalance(base.WorkloadStabilizationBaseStrategy):
295
295
  self.threshold)
296
296
  return self.solution
297
297
 
298
- # choose the server with largest cpu_util
298
+ # choose the server with largest cpu usage
299
299
  source_nodes = sorted(source_nodes,
300
300
  reverse=True,
301
301
  key=lambda x: (x[self._meter]))
@@ -40,17 +40,25 @@ class TestGnocchiHelper(base.BaseTestCase):
40
40
  self.addCleanup(stat_agg_patcher.stop)
41
41
 
42
42
  def test_gnocchi_statistic_aggregation(self, mock_gnocchi):
43
+ vcpus = 2
44
+ mock_instance = mock.Mock(
45
+ id='16a86790-327a-45f9-bc82-45839f062fdc',
46
+ vcpus=vcpus)
47
+
43
48
  gnocchi = mock.MagicMock()
49
+ # cpu time rate of change (ns)
50
+ mock_rate_measure = 360 * 10e+8 * vcpus * 5.5 / 100
44
51
  expected_result = 5.5
45
52
 
46
- expected_measures = [["2017-02-02T09:00:00.000000", 360, 5.5]]
53
+ expected_measures = [
54
+ ["2017-02-02T09:00:00.000000", 360, mock_rate_measure]]
47
55
 
48
56
  gnocchi.metric.get_measures.return_value = expected_measures
49
57
  mock_gnocchi.return_value = gnocchi
50
58
 
51
59
  helper = gnocchi_helper.GnocchiHelper()
52
60
  result = helper.statistic_aggregation(
53
- resource=mock.Mock(id='16a86790-327a-45f9-bc82-45839f062fdc'),
61
+ resource=mock_instance,
54
62
  resource_type='instance',
55
63
  meter_name='instance_cpu_usage',
56
64
  period=300,
@@ -59,6 +67,14 @@ class TestGnocchiHelper(base.BaseTestCase):
59
67
  )
60
68
  self.assertEqual(expected_result, result)
61
69
 
70
+ gnocchi.metric.get_measures.assert_called_once_with(
71
+ metric="cpu",
72
+ start=mock.ANY,
73
+ stop=mock.ANY,
74
+ resource_id=mock_instance.uuid,
75
+ granularity=360,
76
+ aggregation="rate:mean")
77
+
62
78
  def test_gnocchi_statistic_series(self, mock_gnocchi):
63
79
  gnocchi = mock.MagicMock()
64
80
  expected_result = {
@@ -1 +0,0 @@
1
- {"git_version": "1e11c490", "is_release": true}