This repo has not been testing lower-constraints at all due to
broken install_command. If you look at any lower-constraints run and
compare the install python packages with lower-constraints, you see
that those are completely different.
This change removes install_command and updates deps in tox.ini to
follow best practices (moving constraints into deps).
It also updates lower-constraints to newer versions.
Remove broken hacking test.
Co-Authored-By: Justin Ferrieu <jferrieu@objectif-libre.com>
Change-Id: I13daab9e53617266beff7053e50779d1f281802c
This option is useful when using Gnocchi with the patch introduced in
https://github.com/gnocchixyz/gnocchi/pull/1059. That patch can
cause queries to return more than one entry per granularity (
timespan), according to the revisions a resource has. This can be
problematic when using the 'mutate' option of Cloudkitty. Therefore,
we proposed this option to allow operators to discard all
datapoints returned from Gnocchi, but the last one in the
granularity queried by CloudKitty. The default behavior is
maintained, which means, CloudKitty always use all of the data
points returned.
Change-Id: I051ae1fa3ef6ace9aa417f4ccdca929dab0274b2
When working with some type of resources, and for some specific billing
requirements, we need to set costs that will use up to more than 8 digits on
the right side of the comma. By default, the Python object Decimal support 28
digits. Therefore, it makes sense for us to change the MySQL database schema
of CloudKitty to use 28 digits as well on the right side. This will avoid
confusion for people when using this feature.
One can argue that using the `factor` option can also be a solution for that,
but as I mentioned, for people used to Python, that can cause confusions
because the MySQL DB is using a different precision than the one supported in
Python for the data type we use to represent the `cost` field.
Change-Id: Ifbf5b2515c7eaf470b48f2695d1e45eeab708a72
Add file to the reno documentation build to show release notes for
stable/victoria.
Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/victoria.
Change-Id: Ib933e0496eb684e5cb987d3292e7aa834fedb309
Sem-Ver: feature
During initial setup it's useful to know if (and how many) billable
tenants got loaded by the fetcher.
Change-Id: Ib1fbfdde5535ff83f8a657b9542c117a882f802e
hacking 3.0.1 fix the pinning of flake8 to avoid bringing in a new
version with new checks.
bumping the min version for hacking so that any older hacking versions
which auto adopt the new checks are not used.
Change-Id: I80da860ff80bc3766d66511c70eb22467e25df01
assertItemsEqual was removed from Python's unittest.TestCase in
Python 3.3 [1][2]. We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.
[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277
Change-Id: Ib8c2acb373db791c0b74b8bea30d424dc44325a5
When CloudKitty is collecting data from Gnocchi, it opens many
connections to Gnocchi to parallelize the requests; as CloudKitty starts
to fetch the responses from Gnocchi, it releases the connections to the
pool until it starts to overflow (reaching the default limit of the
Requests connection pool). This behavior causes no problems, but
prevents the reuse of connections.
To mitigate this problem and optimize the use of connections, we propose
to add a new configuration in Gnocchi collector and fetcher to set the
connection pool maximum size when connecting to Gnocchi. The new
configuration is `http_pool_maxsize` and you can configure it in the
`cloudkitty.conf` file like:
```
[fetcher_gnocchi]
http_pool_maxsize = 50
[collector_gnocchi]
http_pool_maxsize = 50
```
The default value is defined by the `requests` library which is 10.
Change-Id: I3ee22984dc87b505924e1711bc723bc1c5f160a5
Story: 2008125
Task: 40847
This is useful for operators to setup haproxy and know that one of
the API is alive. I've done such a patch on many other projects,
and this is unifying all.
Change-Id: I14214679849c1cd378c7487254761f1d4d73e10e
Metadata defined in metrics.yml may be non-existent in data['metric']
from Prometheus results. Deal with the exception similarly to the
Gnocchi collector.
Change-Id: I02ee50793f3c46050250ca1c4094dd4ef0736ca6
Signed-off-by: Ning Yao <yaoning@unitedstack.com>
Story: 2008123
Task: 40845
The Prometheus collector was ignoring the mutate definition from
metrics.yml, which may produce wrong resource ratings.
Change-Id: I662f6ac798c20ca43028b3807fa03aacfdcf252b
Signed-off-by: Ning Yao <yaoning@unitedstack.com>
Story: 2008122
Task: 40844
Currently, only the quantity and price are returned in the v2 summary get API.
However, that might not satisfy all user's needs. This PR Enables custom fields
to be used in the Summary get API; thus, we start to allow users/operators/business
people to create richer reports via the summary Get API.
Change-Id: Id4dd83d0703ec0dff32510e6dd1d2dad9b181306
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems
Update Sphinx version as well.
Set openstackdocs_pdf_link to link to PDF file. Note that
the link to the published document only works on docs.openstack.org
where the PDF file is placed in the top-level html directory. The
site-preview places the PDF in a pdf directory.
Disable openstackdocs_auto_name to use 'project' variable as name.
Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.
openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.
See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html
Change-Id: I6be1174686cb1d8f11e8cb4be58c0e739bf0f931
Starting in py38, some of the column calculations have changed. We had
some hacking unit tests that would assert on tuples containing those
column numbers, so things would pass fine when running on py36 or py37,
but would fail when run on py38.
Since we don't really care about the column number, only whether the
hacking check fails or doesn't, we can just match on mock.ANY for that
value.
Change-Id: I117177a43293efb389dd8c0cd5a5c0ee16a7eca9
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
As discussed in https://review.opendev.org/#/c/742477/, this patch
replaces the use of `tz.UTC` with `dateutil.tz.tzutc()`
Also add python-dateutil to requirements.txt, using the same minimum
version as several other OpenStack projects, including nova.
Change-Id: I4da9e8854a571058e48c2f51c1d340bc135cfe2b
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Update local hacking checks for new flake8.
Change-Id: I41a5518f1210c9a1b6d5217bbbcd99bbaa3c9b53
We can now use the standard library mock library instead of the third
party one previously needed for py27 compatibility.
Change-Id: Ia8e87cd6a25621a97c876de5422d0c9d0c8dd751
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Add file to the reno documentation build to show release notes for
stable/ussuri.
Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/ussuri.
Change-Id: I5cf5769d6241dcc22c0665aba7ad368bf63d1abd
Sem-Ver: feature
Class docstrings were being pulled in to multiple locations, causing
sphinx errors due to the duplicate references. This fixes it by adding
the :noindex: option to those references.
Also temporarily disabling the PDF build as that is failing with another
issue that should be fixed in a follow up.
Change-Id: I6de2948ff49e1bb0b6a8b9a3a90f9f2ebbb8b7bb
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
The collector is configurable via the CLOUDKITTY_COLLECTOR variable, no
CLOUDKITTY_GNOCCHI is available.
Change-Id: If433bb26e64747e887af3b191cfae36f31390809
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>