Implements vcpus counter

This is the same kind of counter of memory.

Change-Id: If2e3a0e9c958f1c147ad1cbabcd25539d5b8b68f
Signed-off-by: Julien Danjou <julien@danjou.info>
Add {root,ephemeral}_disk_size counters

Change-Id: Ia4b9a9048df5cfca7cb868ee518297de86c78b71
Signed-off-by: Julien Danjou <julien@danjou.info>
fix use of source value in mongdb driver

Change-Id: I00b3c1c8af7b154516fea4ddb3f588ce2df5e46c
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Skeleton for API server

This changeset introduces a framework for the API service,
including the dependency list, a couple of simple API methods,
a test suite, and documentation for starting the development
server.

Change-Id: I4a496c600b7e6a0a8c70113b1d099614febd899d
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
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>
Change compute pollster API to work on one instance at a time

We will eventually need the compute agent to accept instructions to
poll the status of an instance before nova deletes it (for details
see bug 1005944). This change prepares for that fix by making
the compute agent pollsters take an instance as an argument
provided by the caller, instead of accessing the database directly
to look up the instances known to be running on the current
host.

Change-Id: I6a16405fd65bfb3c190d02f3d70b2bde7fc0fc83
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Add API endpoint for listing raw event data

This change adds some of the endpoints for listing raw
event data from the database. It does not yet support
listing events by project id.

It also fixes a problem with the MongoDB driver returning
Mongo's ObjectId instances in the results of the event
query, which makes them impossible to serialize via JSON.

Change-Id: I08d122ecd2f726fb1b2880bc22e28113f6a3aeb1
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Merge "Implements vcpus counter"
Merge "Add {root,ephemeral}_disk_size counters"
Merge "Add API endpoint for listing raw event data"
collector exception on record_metering_data

Fixes bug 1033413

Change-Id: I7f5ba8fb32ac21e0e7cb3c83c27e9b41beac4a29
Fix "meter" literal in event list API

Change-Id: I55dd108bab9a5aed9730d2c81ecab3a4ed909189
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Add project arg to event and resource queries

Change-Id: Idfb39d02e8af2b00f6f14520b5219f48dcf8fe8a
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Sort list of users and projects returned from queries

Change-Id: Ic41d303d332ccb47907450027f5a09a825cc522f
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Add list projects API

Change-Id: I7d7c62c540f0a57dbd192c08d4d1fe8aa2ea3312
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Merge "Fix "meter" literal in event list API"
Merge "Add project arg to event and resource queries"
Merge "Sort list of users and projects returned from queries"
Merge "Add list projects API"
Be explicit about test dir.

Change-Id: I3516b5d58f58bfeac32a06317b0b3d0704d449f8