Ask Your Question
1

Get total running time of an instance for a given hour

asked 2015-02-24 14:46:31 -0600

lanpar gravatar image

when i get statistics on an instance for a given hour gives a duration of 3000 rather than 3600 based on the samples , you have an api example of how to get the total running time of an instance on a given hour?

edit retag flag offensive close merge delete

Comments

You have some code?

Lera gravatar imageLera ( 2015-02-27 03:37:32 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-08-14 05:11:18 -0600

felix gravatar image

I have the same problem. I am running Openstack Juno, and the Ceilometer version is 1.0.12

Below is my CLI call and the return result:

[root@os-controller ~]# ceilometer statistics --meter cpu_util --query 'project_id=8abf87264b7845a49921af06fa00752e;resource_id=4a859854-e834-4d73-a13a-d1261f0379f2;timestamp>=2015-08-12T00:00:00;timestamp<=2015-08-13T01:00:00' --period 3600

+--------+---------------------+---------------------+---------------+---------------+---------------+---------------+-------+----------+---------------------+---------------------+

| Period | Period Start | Period End | Max | Min | Avg | Sum | Count | Duration | Duration Start | Duration End |

+--------+---------------------+---------------------+---------------+---------------+---------------+---------------+-------+----------+---------------------+---------------------+

| 3600 | 2015-08-12T04:00:00 | 2015-08-12T05:00:00 | 6.69666666667 | 6.62166666667 | 6.65166666667 | 19.955 | 3 | 1200.0 | 2015-08-12T04:30:25 | 2015-08-12T04:50:25 |

| 3600 | 2015-08-12T05:00:00 | 2015-08-12T06:00:00 | 6.64666666667 | 6.6 | 6.62222222222 | 39.7333333333 | 6 | 3000.0 | 2015-08-12T05:00:25 | 2015-08-12T05:50:25 |

| 3600 | 2015-08-12T06:00:00 | 2015-08-12T07:00:00 | 6.715 | 0.0 | 3.33666666667 | 20.02 | 6 | 3000.0 | 2015-08-12T06:00:25 | 2015-08-12T06:50:25 |

| 3600 | 2015-08-12T07:00:00 | 2015-08-12T08:00:00 | 0.0 | 0.0 | 0.0 | 0.0 | 6 | 2999.0 | 2015-08-12T07:00:25 | 2015-08-12T07:50:24 |

You can see the the period is 3600 while the duration is only about 3000, and there's about 10-minute missing from the duration start, end time. I tried to start and then stop this instance in the missing period, no doubt that the ceilometer cannot record the use of CPU. I tried the meter "cpu", "cpu_util", "instance" and these 3 meter return the same result, i.e. missing about 600 seconds.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2015-02-24 14:46:31 -0600

Seen: 417 times

Last updated: Feb 24 '15