在做openstack资源统计监控中通过ceilometer+gnocchi获取cpu、memory的使用率,获取VM虚拟机网卡数据流量统计,虚拟机多网卡分别获取流量统计以及针对虚拟机实例进行总的流量统计,遇到了很多的坑,在一下分别记录,并附上实现的源码。
学习最好的方式,还是先看一下官方的文档介绍:
Using Metering for Compute Resources:
You can collect usage data of compute resources using Gnocchi. This time series database processes and stores measurement data of compute resources and provides access to it via REST API or the command-line tool.
Measurements can be sampled from such compute resources as virtual machines, VM disks and interfaces, compute networks, volumes, etc. All resources are being revised: if any attribute of a resource changes, this change is recorded in the history of the resource. For a VM, for example, you can measure the amo