On 03/06/2018 09:32 AM, Stefan Hajnoczi wrote:
On Wed, Feb 07, 2018 at 03:50:36PM +0300, Vladimir Sementsov-Ogievskiy wrote:
Introduce latency histogram statics for block devices.
For each accounted operation type latency region [0, +inf) is
divided into subregions by several points. Then, calculate
hits for each subregion.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>
---

According to Wikipedia and Mathworld, "intervals" and "bins" are
commonly used terms:
https://en.wikipedia.org/wiki/Histogram
http://mathworld.wolfram.com/Histogram.html

I suggest:

   typedef struct {
       /* The following histogram is represented like this:
        *
        * 5|           *
        * 4|           *
        * 3| *         *
        * 2| *         *    *
        * 1| *    *    *    *
        *  +------------------
        *      10   50   100
        *
        * BlockLatencyHistogram histogram = {
        *     .nbins = 4,
        *     .intervals = {10, 50, 100},
        *     .bins = {3, 1, 5, 2},
        * };

The name 'intervals' is still slightly ambiguous: does it hold the boundary point (0-10 for 10 slots, 10-50 for 40 slots, 50-100, for 50 slots, then 100-INF) or is it the interval size of each slot (first bin is 10 slots for 0-10, next bin is 50 slots wide so 10-60, next bin is 100 slots wide so 60-160, everything else is 160-INF). But the ascii-art diagram plus the text is sufficient to resolve the intent if you keep that name (I don't have a suggestion for a better name).

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to