Gnocchi performs better if measurements are write in batch
When Ceilometer is used with Gnocchi, this is not possible.
This change introduce a new notification listener that allows that.
On the driver side, a default batch implementation is provided.
It's just call the legacy poll method many times.
Driver can override it to provide a better implementation.
For example, kafka handles batch natively and take benefit of this.
Change-Id: I16184da24b8661aff7f4fba6196ecf33165f1a77
To make sure that waiting can be limited by some value, and
will not block forever add and use a timeout keyword argument
to the wait method so that waiting can be limited to some time
duration.
Change-Id: I2529e7bdc2ad449ab9de935c6bc4c6ea144e4f87
This change introduces to possibility for the consumer application
to change the default oslo.messaging config options.
Same API interface as oslo.db have been taken.
The first option is executor_thread_pool_size.
This option was called rpc_thread_pool_size, but because it's used by
notification and rpc 'executor_thread_pool_size' looks a better name.
Changing executor_thread_pool_size default will be useful for ceilometer
the default of 64 is really to small to consume many notifications at
once for batching them. When is clearly sufficient for rpc stuffs.
Change-Id: Iea0d7a72e38d27c600403c815258aa5eee0d0c8c
It appears the the callback variable that was being called on
future done was not the right one, due to the lambda capture
mechanism referring to a lazy variable which would potentially
be a different callback by the time the future would finish so
make sure we capture the right one and ensure the future has access
to it.
This adds a helper method that submission will go through
to ensure that the callback variable is correctly captured
in the created lambda and also ensures that the incomplete futures
list is cleaned up (when the future is done).
The notification listener tests use now eventlet to show up this
issue that doesn't occur with blocking executor.
Closes-bug: #1474943
Closes-bug: #1475307
Change-Id: I23e393d504662532572b5b344b87387be6d7bcb1
Adjust some docstrings to better align with the class
they are attached to. Also changes some docstrings for
the pooled executor (as it is an abstraction on-top of
async executors, and is not tied to threads anymore) and
correctly denote this on its attributes that others can
and are overriding.
Change-Id: I2eaaeed3aa0ae64eb5c82843381b7518ac508ac1
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names. It also adds a local
hacking check to prevent regressions, while disabling style checks in
the "tests" directory, which will be deleted in a subsequent patch.
The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.
Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.
Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages
Change-Id: Iad2ae13c771c99861ca9493c6ab10edcfbd8684a
The context manager in the executor fit only for the blocking executor.
Even the dispatcher needs to run code before and after the application
callback, eventlet and future executors have to run the pre/post code
into the main thread and can run the callback into an other thread,
and that force them to run __enter__ and __exit__ manually and deal
the exception path.
This change adds a helper object instead of the context manager.
It is designed to be explicit on what must be executed
before and after the callback and what can be done in a thread or not.
All the executor code is now in the impl_pooledexecutor.py
and use the futures "PoolExecutor" API.
This use futurist to provide a eventlet and aioeventlet futures friendly
object.
Change-Id: I8cd7640f36beeda47560e3c82671bad3530e38d1