Skip to content

Commit

Permalink
Deleting statistics tables from resource usage page
Browse files Browse the repository at this point in the history
The tables were interpreting the stats in a wrong way, for some stats
it's not even easily possible to get those stats. We need to go through
each statistic separately and document it in the Ceilometer docs first.

Then it's more likely that these table stats will be distributed in
various tables in dashboard in the form of sparklines so these pages
won't be needed.

Fixes bug 1249279

Change-Id: Ib8c110f5d66fae50df12f8f0beeb99c2b2d00bf6
  • Loading branch information
Ladas committed Nov 27, 2013
1 parent 08cdf40 commit 09677c0
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 867 deletions.
135 changes: 0 additions & 135 deletions openstack_dashboard/api/ceilometer.py
Expand Up @@ -218,99 +218,6 @@ class Statistic(base.APIResourceWrapper):
'duration', 'duration_start', 'duration_end']


class GlobalDiskUsage(base.APIResourceWrapper):
"""Represents collection of resources with statistic of defined meters.
Resources are filtered either by given default query or by
meters in python. It's preferred to use default_query as it is more
effective.
"""

_attrs = ["id", "tenant", "user", "resource", "disk_read_bytes",
"disk_read_requests", "disk_write_bytes",
"disk_write_requests"]

meters = ["disk.read.bytes",
"disk.read.requests",
"disk.write.bytes",
"disk.write.requests"]

default_query = [{"field": "metadata.OS-EXT-AZ:availability_zone",
"op": "eq",
"value": "nova"}]
stats_attr = "avg"


class GlobalNetworkTrafficUsage(base.APIResourceWrapper):
"""Represents collection of resources with statistic of defined meters.
Resources are filtered either by given default query or by
meters in python. It's preferred to use default_query as it is more
effective.
"""

_attrs = ["id", "tenant", "user", "resource", "network_incoming_bytes",
"network_incoming_packets", "network_outgoing_bytes",
"network_outgoing_packets"]

meters = ["network.incoming.bytes",
"network.incoming.packets",
"network.outgoing.bytes",
"network.outgoing.packets"]

# TODO(lsmola) once the API will support it need to add default query,
# instead of filtering resources in python by the filter_func
default_query = None
stats_attr = "avg"


class GlobalNetworkUsage(base.APIResourceWrapper):
"""Represents collection of resources with statistic of defined meters.
Resources are filtered either by given default query or by
meters in python. It's preferred to use default_query as it is more
effective.
"""

_attrs = ["id", "tenant", "user", "resource", "network", "network_create",
"subnet", "subnet_create", "port", "port_create", "router",
"router_create", "ip_floating", "ip_floating_create"]

meters = ["network", "network_create",
"subnet", "subnet_create",
"port", "port_create",
"router", "router_create",
"ip_floating", "ip_floating_create"]

# TODO(lsmola) once the API will support it need to add default query,
# instead of filtering resources in python by the filter_func
default_query = None
stats_attr = "max"


class GlobalObjectStoreUsage(base.APIResourceWrapper):
"""Represents collection of resources with statistic of defined meters.
Resources are filtered either by given default query or by
meters in python. It's preferred to use default_query as it is more
effective.
"""

_attrs = ["id", "tenant", "user", "resource", "storage_objects",
"storage_objects_size", "storage_objects_outgoing_bytes",
"storage_objects_incoming_bytes"]

meters = ["storage.objects",
"storage.objects.size",
"storage.objects.incoming.bytes",
"storage.objects.outgoing.bytes"]

# TODO(lsmola) once the API will support it need to add default query,
# instead of filtering resources in python by the filter_func
default_query = None
stats_attr = "avg"


def ceilometerclient(request):
"""Initialization of Ceilometer client."""

Expand Down Expand Up @@ -558,48 +465,6 @@ def filter_resources(resource):

return [used_cls(resource) for resource in resources]

def global_disk_usage(self, query=None, with_statistics=False,
additional_query=None):
"""Wrapper for specific call of global_data_get."""

return self.global_data_get(used_cls=GlobalDiskUsage,
query=query,
with_statistics=with_statistics,
additional_query=additional_query)

def global_network_traffic_usage(self, query=None, with_statistics=False,
additional_query=None):
"""Wrapper for specific call of global_data_get.
"""

return self.global_data_get(used_cls=GlobalNetworkTrafficUsage,
query=query,
with_statistics=with_statistics,
additional_query=additional_query)

def global_network_usage(self, query=None, with_statistics=False,
additional_query=None):
"""Wrapper for specific call of global_data_get.
"""

return self.global_data_get(used_cls=GlobalNetworkUsage,
query=query,
with_statistics=with_statistics,
additional_query=additional_query)

def global_object_store_usage(self, query=None, with_statistics=False,
additional_query=None):
"""Wrapper for specific call of global_data_get.
"""
# TODO(lsmola) This call uses all tenants now. When ajax pagination
# is added, it needs to obtain only paginated tenants.
# self.preload_all_tenants()

return self.global_data_get(used_cls=GlobalObjectStoreUsage,
query=query,
with_statistics=with_statistics,
additional_query=additional_query)

def query_from_object_id(self, object_id):
"""Obtaining a query from resource id.
Expand Down
212 changes: 0 additions & 212 deletions openstack_dashboard/dashboards/admin/metering/tables.py

This file was deleted.

0 comments on commit 09677c0

Please sign in to comment.