The sstore_data_attach_histogram
() Interface
Like sstore_data_attach
(), the sstore_data_attach_histogram
() interface creates a shared memory region between sstored
and the client process. Call sstore_data_attach_histogram
() only one time during the runtime of the client process.
The sstore_data_attach_histogram
() interface creates a shared memory region with an array of counters for each statistic: one counter for each interval defined for the histogram. To update the statistics store, call sstore_histogram_quantize
() to update the appropriate interval counter in the shared memory region. The statistic value can be any data type; sstore_data_attach_histogram
() stores a count of the values. See the sstore_histogram_init
(3SSTORE) man page for more information about interfaces used to store data in a histogram and the types of histograms that are supported by the statistics store.
Latency is a good example for a histogram. If you capture or export a statistic such as //:class.disk//:stat.io-completions//:part.latency
or //:class.scheduler//:stat.cv-signal//:part.latency
, you see a long list of intervals. The value of each interval is the number of times the value of the statistic is in that interval.
The following sstore export
example output shows that 191324 I/O operations completed between 524288 and 1048576 nanoseconds since system boot:
$ sstore export //:class.disk//:stat.io-completions//:part.latency
...
524288: 112392.0
1048576: 191324.0
...