36 Commits

Author SHA1 Message Date
Julien Danjou
d066837415 send-counter: fix & test
This fixes the bin/ceilometer-send-counter program that has been broken
after the implementation of multi-publisher.
We also add a test to see if it runs!

This fixes bug #1133226

Change-Id: I922c7a000e942ee28d840f4cd65d13898d6d23a8
Signed-off-by: Julien Danjou <julien@danjou.info>
2013-02-26 11:57:52 +01:00
Yunhong, Jiang
9335d81316 Support different publisher interval
Changes the agent manager to poll based on pipeline configuration, to
support different interval requirement from different publishers.

This patch clean up the test case for agent managers. It makes the changes
a bit bigger, however, it's not so easy to seprate this cleanup patch
with different interval part.

For bp publisher-counters-frequency

Change-Id: I3c1163e37de6a17261d2c570843845696ebff58f
Signed-off-by: Yunhong, Jiang <yunhong.jiang@intel.com>
2013-02-22 00:37:57 +08:00
Mark McLoughlin
5181724ece Use oslo-config-2013.1b3
The cfg API is now available via the oslo-config library, so switch to
it and remove the copied-and-pasted version.

Add the 2013.1b3 tarball to tools/pip-requires - this will be changed
to 'oslo-config>=2013.1' when oslo-config is published to pypi. This
will happen in time for grizzly final.

For each testenv in tox.ini which overrides the base testenv deps list,
explicitly include {pip,test}-requires in the list so that oslo-config
doesn't fail to install later when easy_install attempts to install
the tarball when doing 'python setup.py install'.

Retain dummy cfg.py file until keystoneclient middleware has been
updated (I18c450174277c8e2d15ed93879da6cd92074c27a).

Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
2013-02-18 12:38:10 +00:00
Doug Hellmann
6ae709c268 Update openstack.common
This update brings in the new join_consumer_pool()
method of the message bus connection class.

Change-Id: Ie5b9bf93c9aaf8f4f85b47b2394969741ba5fef4
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2013-02-14 18:14:15 -05:00
Julien Danjou
a5bc34d932 Simplify ceilometer-api and checks Keystone middleware parsing
This adds some test to be sure options passed to the middleware are read and
user properly.

This fixes bug #1099739

Change-Id: I491db4d2c7387cc2848ebefbbb579597234a82b0
Signed-off-by: Julien Danjou <julien@danjou.info>
2013-01-25 13:45:06 +01:00
guillaume pernot
c0379cefd9 Provide the meters unit's in /meters
* change pollsters and notification handlers to report units
 * modify db storage to store units in counters

Change-Id: Ibd7e52623b84d26ca7bbc9f260c20fdf1d61a4bc
Implements: blueprint provide-meter-units
2013-01-11 14:44:59 +01:00
Julien Danjou
092aad40bd Fix keystoneclient auth_token middleware changes
Things changed, and the configuration wasn't read anymore. This patch fixes
that. It also remove duplicated code in acl.py, so the problem is fixed only
in one place. Finally, it uses prepare_service() to find the right
configuration file for ceilometer.

This fixes bug #1098204

Change-Id: I0d6c30ad443a4d0db201e60d12b275625a4bee6e
Signed-off-by: Julien Danjou <julien@danjou.info>
2013-01-11 11:47:40 +01:00
Julien Danjou
7471586dd6 Pass a dict configuration file to auth_keystone
This fixes bug #1091754

Change-Id: Iff76a2b499d69fc90c31a23e9c79b1b91f63653e
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-12-28 17:58:16 +01:00
Julien Danjou
29f5edad8e Move back api-v1 to the main api
API v2 is not finished and should only be optionnal. Move the binary as
api-v2 and remove the dep on pecan, only use it for tests.

This also fixes bug #1092227.

Change-Id: Ifaf0ad3918460bc2107e1563f0539695467a1856
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-12-20 14:53:57 +01:00
Julien Danjou
eada7872f2 Fix dbsync API change
This binary didn't get modified, so add test to be sure we don't miss it
next time.

Change-Id: I62692e7ee2fd8dd0f4845d130d6b193c7849c5f9
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-12-17 12:42:18 +01:00
Julien Danjou
c6a093511c Implements database upgrade as storage engine independent
Currently, calling ceilometer-dbsync will be default raises an error since
it tries to upgrade a SQL database, even if mongo (the default) is used.
This patch fixes that by adding an upgrade capability to the storage engine
connection base class, and implementing it only in SQL.

Change-Id: I9a0da235ef3a93aaefd1b122d59f244ea293e9fe
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-12-10 14:10:17 +01:00
Angus Salkeld
ad5ff3e4e5 Fix the v1 api importing of acl
Was importing the v2 version.

Change-Id: I9282dfdfffe7f827293817df5a2db96a817b722d
2012-12-10 13:18:40 +11:00
Shane Wang
0b8abf6891 Add sql db option to devstack for ceilometer
Ceilometer uses mongodb as the default storage.
This is one of the patches to support sql db option in devstack for
ceilometer, so users can easily choose and set up sql db environment
for ceilometer with 'stack.sh' by explicitly specifying the following
statement in localrc:

   use_database mysql

where mysql is taken as an example.

If users remove the above statement, mongodb is used and set up
by default.

This patch is for devstack to call dbsync to create ceilometer tables.

Change-Id: Idc9bffd0f389fa9760946b412c39210f60042d90
Signed-off-by: Shane Wang <shane.wang@intel.com>
2012-12-05 13:45:26 +08:00
Doug Hellmann
3173ab4c4b Implement V2 API with Pecan and WSME
This changeset reimplements the API
using Pecan and WSME instead of Flask.

Pecan uses "object dispatch" instead of
declared routes. The controller classes
are chained together to implement the
API.  Most of what we have are simple
REST lookups, but a few cases required
custom methods.

WSME is used to define types of inputs
and outputs for each controller method.
The WSME layer handles serizlization and
deserialization in several formats. In
our case, only JSON and XML are
configured.

There are a few small changes to the
return types in the API, as well as to
error handling. Now all errors are
returned as JSON messages made up of a
mapping containing the key
'error_message' and the text of the
error. This will later be enhanced to
include XML support for XML requests.

This change also moves the script for
starting the V1 API to a new name and
replaces it with a script that starts
the V2 API. There is an open
bug/blueprint to fix that so both
versions of the API are loaded.

blueprint api-server-pecan-wsme

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Change-Id: I1b99a16de68f902370a8999eca073c56f9f14865
2012-12-04 12:57:58 -05:00
Doug Hellmann
42f1f02077 Move v1 API files into a subdirectory
Move all of the files for the v1 API together into a
single directory to make room for the v2 files.

blueprint api-server-pecan-wsme

Change-Id: Ic794581c677a0277924459ad8a34fd7daf2bc365
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-12-04 12:08:13 -05:00
Julien Danjou
97c96f7ebf Remove nova.flags usage
The only one left is now in libvirt for the compute driver. How to remove
this and rewrite this pollster is still under discussion.

This implements blueprint nova-flags-removal.

Change-Id: Ife54e402cb307b9b4cb360d8ee54683ac1e73e1c
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-11-16 18:17:44 +01:00
Jenkins
baa8dcffba Merge "Use the service.py in openstack-common" 2012-11-05 11:32:27 +00:00
Angus Salkeld
2789f144d4 Use the service.py in openstack-common
Also change the collector from a manager into a Service
to make it easier to access the rpc connection.

Change-Id: I1d79abb1db087110d565a9673a48de0502ac2a2b
2012-11-05 08:28:59 +11:00
Julien Danjou
445d711dd0 Allow no configured sources, provide a default file
This fixes bug #1073654

Change-Id: I7cfb5016ab8a70bf9738baa497f6fe173f307242
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-11-04 22:04:07 +01:00
Doug Hellmann
085fa79ec0 Fix auth middleware configuration
Initialze the configuration object before initializing
the middleware, and pass the resulting config in to
the middleware so it can get the configuration settings.

addresses bug #1071047

Change-Id: I2a487d2a2f2d3467e522868ac78dc4645bf7d643
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-10-31 15:46:54 -04:00
Julien Danjou
7b13db7aef add ceilometer-send-counter
This program can be used to send counter manually.

Change-Id: I11a7b7b99cf9aea6b6885cdc4640b8c2da54a564
Signed-off-by: Julien Danjou <julien@danjou.info>
2012-10-26 22:33:27 +02:00
Angus Salkeld
731d3fce5e Add bin/ceilometer-api for convenience
This is a bit more obvious than running the module.
I have basically just moved api/__main__.py into bin/ceilometer-api.

Change-Id: I50d614ea98b278563b576e0b3b9df03b391e2152
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2012-09-03 13:51:12 +10:00
Doug Hellmann
0e8f2359d9 Create "central" agent
This changeset is phase one of changing the pollster API to support
polling individual instance resources. In this change, the single
compute agent is divided into two separate daemons.

The compute agent, for polling instance data, is still meant to
run on the compute server. The new "central" agent, for polling
resources not tied to a compute node, is meant to run on a management
server (probably the same place the collector runs). The configuration
of the pollsters is updated so that they are loaded by the
appropriate agent.

New base classes are introduced for each of the types of pollsters.
For now, the APIs remain the same.

The code implementing the agent and plugins has been moved around
to reflect the new logical relationships, and the documentation
is updated (including new installation instructions).

Change-Id: Ica6e947b2e457f7db6672147af1369a24066037d
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-07-31 09:11:21 -04:00
Doug Hellmann
2fe0a3c3ef Fix nova configuration loading
It seems some option handling within nova has changed, so we need
to update our use of the configuration object. These changes ensure
that the options we care about are registered before they are used.

Change-Id: I0dd34f620eed5f43af6da5b02f9c41d35287c275
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-07-25 15:44:15 -04:00
Julien Danjou
3c01ccefd5 Split service preparation, periodic interval configurable
Change-Id: I71d1e81e2b2347fb7e3ba2edfa7f21eb9cffb401
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
2012-06-26 15:40:38 +02:00
Julien Danjou
8780157755 Add and use ceilometer own log module
This fixes bug #1004130

Change-Id: I143124ad411d5efefa604e831173dca87548bd7f
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
2012-06-07 16:24:07 +02:00
Julien Danjou
6fa69bbdcc Use new flag API
This changed since 00786bc554a2dfacb3c6f02fbb7e9c98f35d4262 for blueprint
cfg-global-object in Nova.

Change-Id: Iaae34a1e4953c964b99411247219f7b72358823f
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
2012-06-04 10:32:16 +02:00
Doug Hellmann
5e0a32f475 Add tox configuration
Change-Id: Ic4051617b5757c649cd59dacf8e9dd9d7e9819a6
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
2012-05-30 15:32:19 +02:00
Doug Hellmann
b76f67d11f Publish and receive metering messages
bug 1004198
bug 1004200

- Set up the collector to receive the metering messages.
- Make the collector republish notifications as metering data.
- Add a "monitor" mode to tools/notificationclient.py to simply print
  the events without writing them to a file.
- Add a --topic flag to tools/notificationclient.py so it can be made
  to listen events other than notifications (for monitoring metering
  events).
- Change "counter_datetime" within the metering message to "timestamp"
  to be consistent with the notification message format.
- Add a configuration option to control the secret value for signing
  metering messages.
- Make the collector and agent daemon control topics more specific.
- Use the config setting to set the metering topic subscription.
- Set a short interval for polling to get more data for development
  testing.
- Log after successful load of pollsters instead of before attempt.

Change-Id: Iedfe26f8a4fa80d88cd0a76e5738001ba5689bdc
2012-05-25 19:31:58 -04:00
Doug Hellmann
bc1f004f8f make the pollsters in the agent plugins
Move user_id and project_id into the Counter
since the polling code has to pull those
values from the instance object.
Convert the libvirt polling code to plugins.
Have the agent manager load the plugins and run
them as part of its periodic task step.

Change-Id: Id59a696beb33c7c9a232460ce52e272f5408e70d
2012-05-23 16:56:32 -04:00
Julien Danjou
5717e9c5c9 Build ceilometer-agent and ceilometer-collector
Change-Id: I0cc5b163ac638f33397e7e7a9c046dca3e2939e9
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
2012-05-23 11:32:49 +02:00
Doug Hellmann
73c9150afe Add plugin support to the notification portion of the collector daemon.
Implement a Counter class for use by notification plugins.
Define a base class for Notification plugins.
Define a dispatcher class for notification events to be passed to the plugins.
Add a notification plugin for instance creation and "instance" counters.
Add a reusable function for turning a Counter into a metering event dictionary.

Change-Id: Iaa626b98e1a661ed31cc8b8e95263c111df20888
2012-05-22 18:17:13 -04:00
Julien Danjou
11a8416190 Periodically fetch for disk io stats
Change-Id: Id48337a598e8941d9e1793ad552251369ef3954f
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
2012-05-14 12:04:58 +02:00
Julien Danjou
6393825cf6 Use nova.service, add a manager class
Change-Id: I76e2b7123c206082f1fca72f94433dac58b72391
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
2012-05-14 12:04:34 +02:00
Julien Danjou
886485c468 Change license to Apache 2.0
Change-Id: I062d722fb570a6f00151eb620d8c169b2ee374ae
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
2012-05-14 11:37:32 +02:00
Julien Danjou
85beac0fa8 Import ceilometer-nova-compute
This script is used to grab notifications from existing hosts

Change-Id: I45826fd6941d7bd93464bf945903b6b41223745c
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
2012-05-09 14:37:14 +02:00