~hudson-openstack/nova/trunk

« back to all changes in this revision

Viewing changes to nova/tests/api/openstack/test_extensions.py

  • Committer: Tarmac
  • Author(s): Vishvananda Ishaya, Anthony Young
  • Date: 2011-09-01 00:16:34 UTC
  • mfrom: (1468.3.13 os-simple-usage)
  • Revision ID: tarmac-20110901001634-bb3whyoipqxc60k5
Simple usage extension for nova.  Uses db to calculate tenant_usage for specified time periods.

Methods:
    * index: return a list of tenant_usages, with option of incuding detailed server_usage
    * show: returns a specific tenant_usage object

tenant_usage object:
    * tenant_usage.total_memory_mb_usage: sum of memory_mb * hours for all instances in tenant for this period
    * tenant_usage.total_local_gb_usage: sum of local_gb * hours for all instances in tenant for this period
    * tenant_usage.total_vcpus_usage: sum of vcpus * hours for all instances in tenant for this period
    * tenant_usage.total_hours: sum of all instance hours for this period
    * tenant_usage.server_usages: A detailed list of server_usages, which describe the usage of a specific server

For larger instances db tables, indexes on instance.launched_at and instance.terminated_at should significantly help performance.

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
            "Quotas",
96
96
            "Rescue",
97
97
            "SecurityGroups",
 
98
            "SimpleTenantUsage",
98
99
            "VSAs",
99
100
            "VirtualInterfaces",
100
101
            "Volumes",