openhistogram / libcircllhist Goto Github PK
View Code? Open in Web Editor NEWA C implementation of OpenHistogram log-linear histograms
License: Apache License 2.0
A C implementation of OpenHistogram log-linear histograms
License: Apache License 2.0
Hi,
I followed the instruction in the readme file but still I am unable to get it working in my mac.
I get the below error
libcircllhist.so was not found on your system.
Please install libcircllhist from: https://github.com/circonus-labs/libcircllhist/
I am debugging this further, but if there are any pointers it will be of great help.
When compiling circllhist_print.c
, Clang emits the following warning due to mismatch of the format specifier and variable type. This does not happen on 64-bit machines, because size_t
is 64-bit long there and matches uint64_t
, but on 32-bit it is not.
circllhist_print.c:28:49: warning: format specifies type 'size_t'
(aka 'unsigned int') but the argument has type 'uint64_t' (aka
'unsigned long long') [-Wformat]
printf("%s\"%g\":%zu", i ? "," : "", v, vc);
~~~ ^~
%llu
1 warning generated.
Using the latest commit release in Envoy Proxy generates the following warnings.
https://github.com/circonus-labs/libcircllhist/blob/master/src/circllhist.c#L1181
https://github.com/circonus-labs/libcircllhist/blob/master/src/circllhist.c#L1241
external/com_github_circonus_labs_libcircllhist/src/circllhist.c:1181:7: warning: unused variable 'i' [-Wunused-variable]
int i, tgt_idx, src_idx;
^
external/com_github_circonus_labs_libcircllhist/src/circllhist.c:1241:7: warning: unused variable 'i' [-Wunused-variable]
int i, tgt_idx, src_idx;
^
2 warnings generated.
The configure.ac
scripts sets up LDFLAGS
for FreeBSD to the value
LDFLAGS="$LDFLAGS -export-dynamic -L/usr/local/lib"
The option -export-dynamic
is interpreted as an option -e
(set entry point) with operand xport-dynamic
which is nonsensical and causes spurious configure test failures. Please patch LDFLAGS
to use -Wl,-E
as on other platforms instead.
Using the latest commit release in Envoy Proxy generates the following warning. It does look like i
is defined at https://github.com/circonus-labs/libcircllhist/blob/master/src/circllhist.c#L926 and not used.
external/com_github_circonus_labs_libcircllhist/src/circllhist.c:926:9: warning: unused variable 'i' [-Wunused-variable]
int i;
^
1 warning generated.
The description for hist_approx_count_below
reads Returns the number of values in buckets that are entirely lower than or equal to threshold
. However, currently the method includes values greater than threshold.
Consider the values 109, 110, 111
stored in the histogram. The counts for the buckets will be as follows:
bucket.val bucket.exp count
hist->bvs[0]: 10 2 1
hist->bvs[1]: 11 2 2
For a threshold of 110, this line will return true for both buckets, even though clearly the value 111 stored in the second bucket is greater than the threshold.
That line should read if (threshold < bucket_lower)
to ensure values over the threshold are not included in the count.
Consider the code
histogram_t* main_thread_interval_hist = hist_alloc();
histogram_t* per_thread_interval_hist = hist_alloc();
hist_insert_intscale(per_thread_interval_hist, 1, 0, 1);
double in[9] = {0, 0.25, 0.5, 0.75, 0.90, 0.95, 0.99, 0.999, 1};
double out[9];
hist_approx_quantile(main_thread_interval_hist, in, 9,out);
histogram_t* hist_array[1];
hist_array[0] = per_thread_interval_hist;
hist_accumulate(main_thread_interval_hist, hist_array, ARRAY_SIZE(hist_array));
hist_clear(per_thread_interval_hist);
//hist_free(per_thread_interval_hist);
//per_thread_interval_hist = hist_alloc();
hist_array[0] = per_thread_interval_hist;
hist_insert_intscale(per_thread_interval_hist, 2, 0, 1);
//hist_clear(main_thread_interval_hist);
//hist_free(main_thread_interval_hist);
main_thread_interval_hist = hist_alloc();
hist_accumulate(main_thread_interval_hist, hist_array, ARRAY_SIZE(hist_array));
hist_approx_quantile(main_thread_interval_hist, in, 9,out);
std::cout<<"after accumulations :"<<out[0]<<"==> \n";
histogram_t* direct_hist = hist_alloc();
hist_insert_intscale(direct_hist, 2, 0, 1);
hist_approx_quantile(direct_hist, in, 9,out);
std::cout<<"direct :"<<out[0]<<"==> \n";
I expect direct and after accumulations to give the same output. But it gives 1 in first bin (rest of the bins are same) for accumulation case and 2 in the direct case.
If I change the code to free and hist_alloc it works correctly in both the cases. Is this is a corner case issue with hist_clear?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.