The ceilometer.storage.impl_log Module

The ceilometer.storage.impl_log Module

Simple logging storage backend.

class ceilometer.storage.impl_log.Connection(conf, url)[source]

Bases: ceilometer.storage.base.Connection

Log the data.

clear()[source]
clear_expired_metering_data(ttl)[source]

Clear expired data from the backend storage system.

Clearing occurs according to the time-to-live. :param ttl: Number of seconds to keep records for.

get_meter_statistics(sample_filter, period=None, groupby=None, aggregate=None)[source]

Return a dictionary containing meter statistics.

Meter statistics is described by the query parameters. The filter must have a meter value set.

{ ‘min’:
‘max’: ‘avg’: ‘sum’: ‘count’: ‘period’: ‘period_start’: ‘period_end’: ‘duration’: ‘duration_start’: ‘duration_end’: }
get_meters(user=None, project=None, resource=None, source=None, limit=None, metaquery=None, unique=False)[source]

Return an iterable of dictionaries containing meter information.

{ ‘name’: name of the meter,
‘type’: type of the meter (gauge, delta, cumulative), ‘resource_id’: UUID of the resource, ‘project_id’: UUID of project owning the resource, ‘user_id’: UUID of user owning the resource, }
Parameters:
  • user – Optional ID for user that owns the resource.
  • project – Optional ID for project that owns the resource.
  • resource – Optional resource filter.
  • source – Optional source filter.
  • limit – Maximum number of results to return.
  • metaquery – Optional dict with metadata to match on.
  • unique – If set to true, return only unique meter information.
get_resources(user=None, project=None, source=None, start_timestamp=None, start_timestamp_op=None, end_timestamp=None, end_timestamp_op=None, metaquery=None, resource=None, limit=None)[source]

Return an iterable of dictionaries containing resource information.

{ ‘resource_id’: UUID of the resource,
‘project_id’: UUID of project owning the resource, ‘user_id’: UUID of user owning the resource, ‘timestamp’: UTC datetime of last update to the resource, ‘metadata’: most current metadata for the resource, ‘meter’: list of the meters reporting data for the resource, }
Parameters:
  • user – Optional ID for user that owns the resource.
  • project – Optional ID for project that owns the resource.
  • source – Optional source filter.
  • start_timestamp – Optional modified timestamp start range.
  • start_timestamp_op – Optional start time operator, like gt, ge.
  • end_timestamp – Optional modified timestamp end range.
  • end_timestamp_op – Optional end time operator, like lt, le.
  • metaquery – Optional dict with metadata to match on.
  • resource – Optional resource filter.
  • limit – Maximum number of results to return.
get_samples(sample_filter, limit=None)[source]

Return an iterable of samples.

Items are created by ceilometer.publisher.utils.meter_message_from_counter.

record_metering_data(data)[source]

Write the data to the backend storage system.

Parameters:data – a dictionary such as returned by ceilometer.meter.meter_message_from_counter.
upgrade()[source]
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.