xapi-project/xen-api — pull request #1909 by zli (2014-09-03 09:17:21+00:00)
Title: CA-136972: Read raw stats from blktap3

This is a revised version of #1883 by @siddharthv. Things worth noting:

* The only change by this pull req (compared with @siddharthv's original) is making use of OCaml/C binding, whereas the algorithm in the original pull req is untouched.

* A successful compilation will depend on Thanos' pull req xapi-project/blktap#97 being merged first (given if the compiler.h issue previously reported being fixed)

* I've verified that the code can generate data stream successfully, though the correctness of these figures has to depend on the validity of data sources (blktap3) and the original import algorithm, which is not in the the scope of this work.

* Also, the original pull req is only about devX_read, devX_write, devX_read_latency, devX_write_latency. I'm not sure about the status of other data sources such as devX_iops_read/write/total etc.

* Currently the binding returns 6 fields of the original struct as a tuple. Suppose if we need more fields later on, it's better to read out all the fields and convert them to a OCaml record type instead.