State Meter for measuring of state changes and accurate uptime calculation.

Registered by Adrian Turjak

A set of plugins similar to the instance meter where the gauge volume entry is used to represent current state (as based on nova vm_states, mapped to an int).

This should be a notification plugin, as well as a pollster, so that the meter is updated on an interval, but also on every state change in the VM.

This would provide an accurate set of state changes and allow for uptime calculations that take into account different states and are accurate down to the second.

Thus a user could calculated uptime for only given states (e.g. active, paused, building, etc), and ignore states such as suspended/stopped if they wanted.

Also be able to track state changes easily and graph/document them.

Implementation so far is avaible here:
https://github.com/Adrian-Turjak/ceilometer/tree/stable/havana

I only have it working on Havana as master does not currently seem to have working notifications but can easily implement that once they are.

Base implementation is there, but work is needed in regards to testing, and also how to deal with vm_state -> int mappings. Have tried using nova.compute.vm_states directly to use the same names, but that was causing issues so I reverted.

Example output:

+--------------------------------------+-------+-------+--------+-------+----------------------------+
| Resource ID | Name | Type | Volume | Unit | Timestamp |
+--------------------------------------+-------+-------+--------+-------+----------------------------+
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 1.0 | state | 2014-01-16T21:33:02.991392 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 1.0 | state | 2014-01-16T21:33:02.969359 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 4.0 | state | 2014-01-16T21:32:59.179866 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 4.0 | state | 2014-01-16T21:32:55.537656 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 4.0 | state | 2014-01-16T21:32:55.489866 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 1.0 | state | 2014-01-16T21:32:55 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 1.0 | state | 2014-01-16T21:32:49.663468 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 1.0 | state | 2014-01-16T21:32:29.947230 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 1.0 | state | 2014-01-16T21:32:29.831882 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 2.0 | state | 2014-01-16T21:32:26.088768 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 2.0 | state | 2014-01-16T21:32:22.281758 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 2.0 | state | 2014-01-16T21:32:21.933268 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 2.0 | state | 2014-01-16T21:32:21.703004 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 2.0 | state | 2014-01-16T21:32:21.525245 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 2.0 | state | 2014-01-16T21:32:21.414301 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 2.0 | state | 2014-01-16T21:32:21.306345 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 2.0 | state | 2014-01-16T21:32:21.218091 |
| e19c3337-e2b8-4395-913c-226f51ec38f7 | state | gauge | 2.0 | state | 2014-01-16T21:32:20.759200 |
+--------------------------------------+-------+-------+--------+-------+----------------------------+

Blueprint information

Status:
Complete
Approver:
None
Priority:
Low
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Obsolete
Series goal:
Accepted for future
Implementation:
Needs Code Review
Milestone target:
milestone icon next
Started by
Adrian Turjak
Completed by
gordon chung

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/state-meter,n,z

Addressed by: https://review.openstack.org/75193
    Adds a state metric to ceilometer

can someone confirm that this is covered by the following patch: https://review.openstack.org/#/c/84438/

Has indeed been covered by that patch, feel free to close this.
-Adrian Turjak

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.