OpenStack Telemetry (Ceilometer)
2511cfb6e4
What this does is store a key value pair in oslo_cache where the key is the resource id and the value is a hash of the frozenset of the attributes of the resource less the defined metrics[1]. When it is time to create or update a resource we ask the cache: Are the resource attributes I'm about to store the same as the last ones stored for this id? If the answer is yes we don't need to store the resource. That's all it does and that is all it needs to do because if the cache fails to have the correct information that's the same as the cache not existing in the first place. To get this to work in the face of eventlet's eager beavering we need to lock around create_resource and update_resource so that we have a chance to write the cache before another *_resource is called in this process. Superficial investigation shows that this works out pretty well because when, for example, you start a new instance the collector will all of sudden try several _create_resources, only one of which actually needs to happen. The lock makes sure only that one happens when there is just one collector. Where there are several collectors that won't be the case but _some_ of them will be stopped. And that's the point here: better not perfect. The cache is implemented using oslo_cache which can be configured via oslo_config with an entry such as: [cache] backend = dogpile.cache.redis backend_argument = url:redis://localhost:6379 backend_argument = db:0 backend_argument = distributed_lock:True backend_argument = redis_expiration_time:600 The cache is exercised most for resource updates (as you might expect) but does still sometimes get engaged for resource creates (as described above). A cache_key_mangler is used to ensure that keys generated by the gnocchi dispatcher are in their own namespace. [1] Metrics are not included because they are represented as sub-dicts which are not hashable and thus cannot go in the frozenset. Since the metrics are fairly static (coming from a yaml file near you, soon) this shouldn't be a problem. If it is then we can come up with a way to create a hash that can deal with sub-dicts. Closes-Bug: #1483634 Change-Id: I1f2da145ca87712cd2ff5b8afecf1bca0ba53788 |
||
---|---|---|
ceilometer | ||
devstack | ||
doc | ||
etc | ||
rally-jobs | ||
releasenotes | ||
tools | ||
.coveragerc | ||
.gitignore | ||
.gitreview | ||
.mailmap | ||
.testr.conf | ||
babel.cfg | ||
CONTRIBUTING.rst | ||
functions.sh | ||
HACKING.rst | ||
LICENSE | ||
MAINTAINERS | ||
pylintrc | ||
README.rst | ||
ReleaseNotes | ||
requirements.txt | ||
run-functional-tests.sh | ||
setup-test-env-es.sh | ||
setup-test-env-mongodb.sh | ||
setup-test-env-mysql.sh | ||
setup-test-env-postgresql.sh | ||
setup.cfg | ||
setup.py | ||
test-requirements.txt | ||
tox.ini |
ceilometer
See the ReleaseNotes document and the project home for more info.