GridGain Developers Hub

Understanding Monitoring Results

Working with Histograms

Some metrics return histograms. Histogram metrics are exported as JSON strings and look like something like this:

{
  "bounds":
    [1,2,4,8,16,25,50,75,100,250,500,750,1000,3000,5000,10000,25000,60000],
  "values":
    [
      {"fromExclusive":0,"toInclusive":1,"value":0},
      {"fromExclusive":1,"toInclusive":2,"value":0},
      {"fromExclusive":2,"toInclusive":4,"value":0},
      {"fromExclusive":4,"toInclusive":8,"value":0},
      {"fromExclusive":8,"toInclusive":16,"value":0},
      {"fromExclusive":16,"toInclusive":25,"value":0},
      {"fromExclusive":25,"toInclusive":50,"value":0},
      {"fromExclusive":50,"toInclusive":75,"value":2},
      {"fromExclusive":75,"toInclusive":100,"value":0},
      {"fromExclusive":100,"toInclusive":250,"value":0},
      {"fromExclusive":250,"toInclusive":500,"value":0},
      {"fromExclusive":500,"toInclusive":750,"value":0},
      {"fromExclusive":750,"toInclusive":1000,"value":0},
      {"fromExclusive":1000,"toInclusive":3000,"value":1},
      {"fromExclusive":3000,"toInclusive":5000,"value":0},
      {"fromExclusive":5000,"toInclusive":10000,"value":0},
      {"fromExclusive":10000,"toInclusive":25000,"value":0},
      {"fromExclusive":25000,"toInclusive":60000,"value":0},
      {"fromExclusive":60000,"value":0}
    ]
}

In the histogram, "bounds" is metadata, separate from the actual time values, and it is used to separate the spectrum of data values into buckets. For example, in the histogram above, the "bounds" field shows 18 values. The first bucket always starts with 0, so in our example, the first "bucket" is 0 - 1 with the 1 being inclusive.

The last bucket always includes "infinity", so in our example the final bucket is 60000 and higher. So, any value higher than 60000 is put into that bucket.

If a datapoint/value for the histogram above is 1500 milliseconds, it will fall into the 1000 - 3000 bucket and result in the "value" for that bucket being incremented ("value":1).