ujson is faster than jsonutils, and we do not need any fancy feature jsonutils
might offer.
This also has the benefit of removing a big dependency on Ceilometer.
Change-Id: I24bf08d0fa6ccc34beef0a0c34a47bf2fa266e3e
The current way to calculate rate of change is not precise at all and
depends on the local host clock. So, we have good chance that the host
clock derive a bit between each polling. Also the timestamp is polling
cycle run and not the exact polled sample.
This makes the rate of change transformer not accurate, and maybe wrong
if the local clock have jumped to much or if a pollster make to much
time to get the stats (libvirt reconnection, ...).
A sample gets a new attribute monotonic_time, where we can store an
accurate polling time using monotonic.monotonic().
In rate of change transformer, if the monotonic time is available we use
to calculate the time delta between samples.
For instance metrics, we set monotonic_time as soon as we poll it from
libvirt, avoiding almost all precision issue.
That makes the rate of change precise to the nanoseconds for polled
samples, while keeping the timestamp identical for all samples polled
during one cycle.
Related-bug: #1527620
Change-Id: I40e14fb6aa595a86df9767be5758f52b7ceafc8f
os-xenapi contains all XenServer dom0 plugins and provide utility
tools for communicating to XenServer dom0 plugins, currently both
nova and neutron projects are using os-xenapi. This patch is to
change ceilometer to use os-xenapi too.
Change-Id: I14819fd57305edb0f4337af88e56ed6b980d7da8
To comply with the upper-constraints defined in OpenStack
Requirements, the upper constraint for sqlalchemy has been
removed
Change-Id: Icb48c61b9022216a9593cdf20bb6166cb742fe56
Closes-Bug: #1687641
Some configuration options were accepting both IP addresses
and hostnames. Since there was no specific OSLO opt type to
support this, we were using "StrOpt". The change [1] that added
support for "HostAddressOpt" type was merged in Ocata and became
available for use with oslo version 3.22.
This patch changes the opt type of configuration options to use
this more relevant opt type - HostAddressOpt.
[1] I77bdb64b7e6e56ce761d76696bc4448a9bd325eb
Change-Id: I2463fc873bb149cafa802f5743d5f482f25552fc
tenacity is defined twice in requirements.txt for ceilometer. This
removes the definition with the lower requirement.
Change-Id: I9c94c4950e81223a73e0514e03697cdca562c28d
Closes-Bug: #1673798
This also switches the coordination to zake:// in test so the code actually
works like it would with a production-ready coordinator.
Change-Id: I38f6a3389f70bed6b45fa7526a13d0484bfc9c3f
Error handling of libvirt driver work 'sometimes'.
Some error are catched only with we lookup for a instance
uuid, but not for other libvirt operation.
This change rewrites the logic to catch libvirt error on
each inpector method. This ensures we catch all errors whatever
which libvirt method raises it.
We also leverage tenacity instead of the custom retry code.
Change-Id: Idd54c18ece42c2dce3baf82626d30d5c2e5a49d6
kafka-python is bumped to 1.3.2 in order to support Kafka 0.10.x
oslo.messaging is bumped to 5.12.0 in order to support kafka-python (there is
a changed parameter name that causes a stacktrace otherwise)
Change-Id: I630b999a050d7186d8c5fb38a24034a7f063c24b
This change introduces a new method to get instances
metadata on the ceilometer-compute-agent.
This switches devstack/gate to libvirt_metadata for gnocchi
Change-Id: Ice1918659be49589a45d7a406044adc0a187aa27
https://review.openstack.org/#/c/387193/ introduced import of
cotyledon.oslo_config_glue wich was introduced in release 1.3.0, so
we should require at least this version.
Change-Id: Icd8cd0e36266d824f3a0233106781739f7c36f4b
We are replacing all usages of the 'retrying' package with
'tenacity' as the author of retrying is not actively maintaining
the project. Tenacity is a fork of retrying, but has improved the
interface and extensibility (see [1] for more details). Our end
goal here is removing the retrying package from our requirements.
Tenacity provides the same functionality as retrying, but has the
following major differences to account for:
- tenacity uses seconds rather than ms as retrying did.
- tenacity has different kwargs for the decorator and
Retrying class itself.
- tenacity has a different approach for retrying args by
using classes for its stop/wait/retry kwargs.
- By default tenacity raises a RetryError if a retried callable
times out; retrying raises the last exception from the callable.
Tenacity provides backwards compatibility here by offering
the 'reraise' kwarg.
- tenacity defines 'time.sleep' as a default value for a kwarg.
That said consumers who need to mock patch time.sleep
need to account for this via mocking of time.sleep before
tenacity is imported.
This patch updates all usages of retrying with tenacity.
Unit tests will be added where applicable.
Note: This change is not newton critical so projects are welcome
to hold off on committing until post-newton. Ideally this change
will merge by the first part of Ocata so dependant functionality
can land and have time to solidify for Ocata.
[1] https://github.com/jd/tenacity
Closes-Bug: #1635394
Change-Id: I0ad7deee3f17f6626708369371167184a40e6368
This change add the support of metering size of volume/snapshot/backup.
Blueprint add-support-of-metering-volume-related-resources
Change-Id: I9c6ec1e79c267255e7839d70324726e56bc6d768
SimpleProducer is marked as deprecated at kafka-python library [1].
The deprecated method causes "FailedPayloadsError: FailedPayloadsError" error.
This patch replaces SimpleProducer with KafkaProducer.
[1] http://kafka-python.readthedocs.io/en/1.1.1/simple.html
Change-Id: I7c979e1064c9c42e82ae71e2631a3d2bd0462839
Closes-bug: #1628456
webob start to support 308 at version 1.5.0
"HTTP Status Code 308 is now supported as a Permanent Redirect"
Change-Id: I27eef9585e88ef4e75678b9c7530bca230c3b42b
There is a minimum version requirement of cotyledon for
ceilometer-collector to work properly. We need to make sure it's above
version 1.2.4.
Change-Id: I07276d032f7f8849501f94f9577833c1d9b68131
Closes-Bug: #1632925
The options from oslo.db are also used by other storage drivers such as
MongoDB, which makes it mandatory even for this backend.
Change-Id: I3b09cffca1285ff92c0c7492b5b48c6a560251e5
Closes-Bug: #1624692
The oslo.messaging<5.2.0(the v5.2.0 update change is in review[1])
depends on amqp>=1.4.0, in amqp-2.0 and amqp2.0.1, there is an issue[2]
that lead the amqp cannot be correctly installed in py34
environment(the depent package vine-1.1.0 of amqp won't bee installed),
that has borken the ceilometer py34 job[3]. we can wait the change[1]
merged and then bump the oslo.message version to avoid this issue. Because
Ceilometer don't participate the global-requirements, so we bump the
oslo.messaging to 5.2.0.
[1] https://review.openstack.org/#/c/324023/
[2] https://github.com/celery/py-amqp/issues/91
[3] http://logs.openstack.org/41/323641/4/check/gate-ceilometer-python34/cf3f043/console.html
Change-Id: Icb34a7f0e03662868aa0ce6e060c5e951711b79e
This change removes usage of eventlet timers.
This allows coordinator heartbeat/watchers to work correctly when
the main thread is stuck for any reason (IO, time.sleep, ...).
Change-Id: I847aebb0d0166c2b46505061a15a06e3ce1b5eb2
Closes-Bug: #1566887
python-ceilometerclient is requried in previous alarming service,
since alarming code is removed, we don't directly use it any more.
Change-Id: Icfccd591d650e20cf62c6d37706681a43e3ff559
We don't pass any oslo.context object around anymore, we just pass dict
if we really need to send some context information – which we barely
need actually.
And remove oslo.context!
Change-Id: I17d15c043b5c7d508af9a43f50511817f9e81151