Name Date Size

..19-Aug-20204 KiB

.gitignoreH A D19-Aug-2020748

appveyor.ymlH A D19-Aug-2020624

CMakeLists.txtH A D19-Aug-20201.7 KiB

COPYING.txtH A D19-Aug-20206.9 KiB

examples/H19-Aug-20204 KiB

ide/H19-Aug-20204 KiB

LICENSE.txtH A D19-Aug-20202.1 KiB

README.mdH A D19-Aug-20202.3 KiB

src/H19-Aug-20204 KiB

test/H19-Aug-20204 KiB

README.md

1HdrHistogram_c: 'C' port of High Dynamic Range (HDR) Histogram
2
3HdrHistogram
4----------------------------------------------
5
6[![Gitter chat](https://badges.gitter.im/HdrHistogram/HdrHistogram.png)](https://gitter.im/HdrHistogram/HdrHistogram)
7
8Windows Build: ![AppVeyor](https://ci.appveyor.com/api/projects/status/github/HdrHistogram/HdrHistogram_c)
9
10Linux Build: [![Build Status](https://semaphoreci.com/api/v1/mikeb01/hdrhistogram_c/branches/master/badge.svg)](https://semaphoreci.com/mikeb01/hdrhistogram_c)
11
12This port contains a subset of the functionality supported by the Java
13implementation.  The current supported features are:
14
15* Standard histogram with 64 bit counts (32/16 bit counts not supported)
16* All iterator types (all values, recorded, percentiles, linear, logarithmic)
17* Histogram serialisation (encoding version 1.2, decoding 1.0-1.2)
18* Reader/writer phaser and interval recorder
19
20Features not supported, but planned
21
22* Auto-resizing of histograms
23
24Features unlikely to be implemented
25
26* Double histograms
27* Atomic/Concurrent histograms
28* 16/32 bit histograms
29
30# Simple Tutorial
31
32## Recording values
33
34```C
35#include <hdr_histogram.h>
36
37struct hdr_histogram* histogram;
38
39// Initialise the histogram
40hdr_init(
41    1,  // Minimum value
42    INT64_C(3600000000),  // Maximum value
43    3,  // Number of significant figures
44    &histogram)  // Pointer to initialise
45
46// Record value
47hdr_record_value(
48    histogram,  // Histogram to record to
49    value)  // Value to record
50
51// Record value n times
52hdr_record_values(
53    histogram,  // Histogram to record to
54    value,  // Value to record
55    10)  // Record value 10 times
56
57// Record value with correction for co-ordinated omission.
58hdr_record_corrected_value(
59    histogram,  // Histogram to record to
60    value,  // Value to record
61    1000)  // Record with expected interval of 1000.
62
63// Print out the values of the histogram
64hdr_percentiles_print(
65    histogram,
66    stdout,  // File to write to
67    5,  // Granularity of printed values
68    1.0,  // Multiplier for results
69    CLASSIC);  // Format CLASSIC/CSV supported.
70```
71
72## More examples
73
74For more detailed examples of recording and logging results look at the
75[hdr_decoder](examples/hdr_decoder.c)
76and [hiccup](examples/hiccup.c)
77examples.  You can run hiccup and decoder
78and pipe the results of one into the other.
79
80```
81$ ./examples/hiccup | ./examples/hdr_decoder
82```
83