[openstack-dev] [Ceilometer] Is that possible to implement new APIs for horizon to show the usage report and charts?

Brooklyn Chen brooklyn.chen at canonical.com
Tue Jul 23 09:44:13 UTC 2013


I am working on the ceilometer-horizon blueprint to show ceilometer data on
horizon(https://blueprints.launchpad.net/horizon/+spec/ceilometer ), now
I've added some tables and chart to horizon:

[image: Inline image 1]

[image: Inline image 2]

1. Need api for horizon to get data for resource usage tables.

There're some issues as ceilometer-api doesn't provide functions for
horizon to get data for the table directly like nova-api does.

Horizon needs to get meter-list at first and then get statistics for each
resource and then combine these resources to one table. It takes about 10
seconds for horizon to load and re-construct these data. It's horrible.
Though asynchronous loading of these tables is implemented and the time for
that is reduced to 3 seconds, the code looks weird. :(

It would be helpful if ceilometer-api provides following api:

GET /v2/usages/disk/

Parameters:  q(list(Query)) Filter rules for the resources to be returned.
Return Type: list(Usage) A list of usage with different tenant,user,
resource

GET /v2/usages/disk/<usage_id>

Parameters:  q(list(Query)) Filter rules for the resources to be returned.
                    usage_id(unicode) The uuid of usage.
Return Type: Usage

type Usage:
{
    "id": "unique_usage_id",
    "tenant": "tenant_id",
    "user": "user_id",
    "resource": "resource_id",
    "metadata": {
        /* This is important since it's intuitive for
         * users to know the details.
         */
        "tenant_name": "tenant_name",
        "user_name": "user_name",
        "resource_name": "resource_name"
    },
    "data": [{
            "meter_name": "disk.read.bytes",
            "unit": "Byte",
            "value": "1024"
        }, {
            "meter_name": "disk.read.requests",
            "unit": "Packet",
            "value": "1024"
        }, {
            "meter_name": "disk.write.bytes",
            "unit": "Byte",
            "value": "1024"
        }, {
            "meter_name": "disk.write.requests",
            "unit": "Packet",
            "value": "1024"
        }
    ]
}


2. need gauge data like "cpu_util" to render stat charts.
We have cumulative meters like "disk.read.bytes" and
"networking.incoming.bytes" but they are not able to be used for drawing
charts since the value of them are always increasing.

Horizon need gauge data for these meters to show the status of resource
usage.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130723/6758de08/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: line_chart.png
Type: image/png
Size: 92590 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130723/6758de08/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: disk_usage.png
Type: image/png
Size: 92340 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130723/6758de08/attachment-0001.png>


More information about the OpenStack-dev mailing list