Use correct hostname to get instances.

socket.getfqdn() would return a fully qualified domain name
which maybe invalid for nova to get instances by hostname.
If the host that runs devstack is virtual(like running
devstack on AWS), socket.getfqdn() may return a domain name
which is not the host name and nova cannot use that to get
instances running on current host.

Fix bug: #1166717

Change-Id: Ic6cc8607bcdeee720c5d46d44fbaa589b4fb950e
Allow to specify the endpoint type to use

Not everybody will want to use publicURL, so let's make this configurable.

Change-Id: Ice85a8ef1083580d89285e83239de872939665af
Fixes: bug#1188469
Allow simpler scale exprs in transformer.conversions

For convenience of deployers, allow scale expression to be
expressed as for example:

  100.0 / (10**9 * (resource_metadata.cpu_number or 1))

instead of requiring that the full dict lookup syntax with
default value is used:

  100.0 / (10**9 * (resource_metadata.get('cpu_number', 1))

Unknown items evaluate to false in boolean expressions such
as:

  resource_metadata.non.existent or 1.0

Change-Id: I2f1f84641222057b4d6213dcfd1c16f23ae9f273
Emit cpu_util from transformer instead of pollster

The emission of the cpu_util counter from the compute CPUUtilPollster
can be superceeded by the RateOfChangeTransformer (the intended
target usercase for the new transformer).

The caching of the CPUStats is now no longer required.

Note that the pipeline.yaml must be updated in deployments, otherwise
the cpu_util meter will no longer be collected.

Change-Id: I79ff047595b960de7a2acb2ec81c357fe2ee21e5
Use run-tests.sh for tox coverage tests

The coverage tests mustn't run in parallel and must have a working
mongod instance like other tests.

So just use the run-tests.sh with a special flags --coverage

Fix bug #1199411

Change-Id: Id750697a69213ee753280b7adc8f726dbdb1fca5
File based publisher

Ceilometer logs metering data into a database by default. In some cases
it is ideal to have the metering data go into a file which can be
examined easily. This patch adds the file based publisher. One can
make changes to pipeline.yaml file to add the file publisher to
an existing pipeline or a new pipeline so that metering data can not
only be saved in database but also can be saved in a file.

The following example shows how it can be configured in pipeline.

    -
        name: meter_file
        interval: 600
        counters:
            - "*"
        transformers:
        publishers:
            - file:///tmp/meters?max_bytes=10000000&backup_count=5

With the above configuration, a set of files named meters can be
found in the /tmp directory. The file names should be meters, meters.1,
meters.2 etc. These files will contain the metering data. Since the
implementation uses rotating log file when max_bytes and backup_count
are specified, one can increase the backup_count and max_bytes to keep
the file for a longer period or use the path to point the file to a
desired location. If no file path specified, the publisher will log an
error and not record any metering data.

Change-Id: If85ad95f837b2d178527eb7de16707f8af2c4ce2
Merge "Allow to specify the endpoint type to use"
Merge "Use correct hostname to get instances."
Merge "Use run-tests.sh for tox coverage tests"
Ensure correct return code of run-tests.sh

If 'kill -9 mongodb_pid' failed, run-tests.sh exit with a
return code of 0.

This change ensure that the return code is the one of the failed
command.

Change-Id: Iad58dac3fa66d1ea688af706940511033c1d76f7
Imported Translations from Transifex

Change-Id: I9b45b4e74f7993d5ad962bdeb9bc35bfa8444841
Implement a basic REST alarm notification

This change adds schemes http:// to the alarm notifier.

The URL is called as a POST request.
The body of request contains a json dictionnary with alarm state and the
reason.

Change-Id: I0dbdd6afdef1a88602c9fbc55d651d3d8f6ad3e0
Blueprint: alarm-notifier
Merge "Allow simpler scale exprs in transformer.conversions"
Merge "Emit cpu_util from transformer instead of pollster"
Allow to enable time to live on metering sample

The collector start the metering sample cleanup
process every 'database_clear_expired_data_interval' seconds to
remove sample according the 'database_time_to_live'

If the backend support ttl natively (mongodb >= 2.2), the cleanup
function in the backend is just a dump, and the backend handles the TTL
itself.

If the backend doesn't support ttl at all, it will raise a
NotImplementedException caught by collector to fill the log correctly.

Blueprint: db-ttl

Change-Id: I869ce6f50065d0ae8d7095a260efbfcd33165eef
Added alembic migrations

Added alembic dependency to requirements
Created alembic config files

To create alembic migration:
$ cd ./ceilometer/storage/sqlalchemy/alembic
$ alembic revision -m "migration_description"

Related to blueprint convert-to-alembic

Change-Id: I59cf409106e0ba8bb819f7fc6aeddd0a837fee4c
Merge "Imported Translations from Transifex"
Disable mongod prealloc, wait for it to start

No prealloc should make mongod starts faster, and the while loop will
wait it is listening before running the tests.

Change-Id: Ia2ff201c0cfa882aa00bb7ce8ce990525f18339e
Merge "Implement a basic REST alarm notification"
Merge "File based publisher"