Skip to content

Add distribution metrics #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 91 commits into
base: project-bkjg
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
5670907
Add distribution header file
bkjg Jul 23, 2020
e060f37
Add draft of distribution functions
bkjg Jul 23, 2020
25be9e0
Add implementation of distribution_new_linear function
bkjg Jul 23, 2020
0144c2f
Add implementation of bucket_new_linear function
bkjg Jul 23, 2020
d14f5b9
Remove one argument from distribution_new_exponential function
bkjg Jul 23, 2020
3721e29
Add implementation of distribution_new_exponential function
bkjg Jul 23, 2020
8922e23
Add implementation of bucket_new_exponential function
bkjg Jul 23, 2020
7ac8dfd
Add implementation of distribution_new_custom function
bkjg Jul 23, 2020
4c155e5
Add implementation of distribution_destroy function
bkjg Jul 23, 2020
7578c49
Add implementation of bucket_new_custom function
bkjg Jul 23, 2020
27bdc61
Fix bugs
bkjg Jul 24, 2020
009a5bb
Add implementation of distribution_update function
bkjg Jul 24, 2020
ae32597
Add implementation of distribution_percentile function
bkjg Jul 24, 2020
40bc6eb
Add implementation of distribution_average function
bkjg Jul 24, 2020
bba200a
Add mutex to distribution_update function
bkjg Jul 24, 2020
18fe3a4
Add implementation of distribution_clone function
bkjg Jul 24, 2020
6108428
Change the type returned by distribution_clone function
bkjg Jul 24, 2020
618c944
Add cheking null pointeres
bkjg Jul 27, 2020
52c8e49
Make the code thread safe
bkjg Jul 27, 2020
7169ca3
Little pointers fixes
bkjg Jul 27, 2020
b8a766b
Add initial_size to distribution_h structure
bkjg Jul 27, 2020
2fb1e01
Clang format
bkjg Jul 27, 2020
fc5e6e6
Add initialization and destruction of mutex
bkjg Jul 27, 2020
6c91ed6
Fix potential attempt to read a null pointer
bkjg Jul 27, 2020
43cdba6
Add distribution metrics to the build system
bkjg Jul 28, 2020
d080a28
Replace copying distribution metrics by mutex
bkjg Jul 28, 2020
0e7ff74
Changed custom_bucket_sizes to custom_bucket_boundaries
bkjg Jul 28, 2020
200cd28
Extend the comments in distribution.h file
bkjg Jul 28, 2020
791f9bf
Change the values returned from percentile and average functions
bkjg Jul 28, 2020
980aa9d
Add license
bkjg Jul 28, 2020
5157345
Fix email in the license
bkjg Jul 28, 2020
13cfe62
Add checking the correctness of the boundaries
bkjg Jul 28, 2020
c2aa581
Rename num_buckets to num_boundaries for custom boundaries
bkjg Jul 28, 2020
37d5df8
Fix seg fault in distribution initializating functions
bkjg Jul 29, 2020
4b05e22
Fix the seg fault in distribution_new_custom function
bkjg Jul 29, 2020
013e65b
Add function for comparision of distributions
bkjg Jul 30, 2020
48617a1
Remove casting pointers after calloc
bkjg Jul 30, 2020
93d8a7a
Add casting to uint64_t in distribution_percentile function
bkjg Jul 30, 2020
8ed4657
Rename ptr to idx in bucket_update function
bkjg Jul 30, 2020
959f65e
Add comment in distribution.h file
bkjg Jul 30, 2020
4f9777e
Add condition to distribution_percentile function
bkjg Jul 30, 2020
3897da0
Fix binary search algorithm
bkjg Jul 30, 2020
e3982c3
Add distribution tests to the build system
bkjg Jul 29, 2020
c32146e
Add first distribution test - testing distribution_new_linear
bkjg Jul 29, 2020
66b81a0
Add unit tests for distribution_new_linear function
bkjg Jul 29, 2020
02b61bb
Add unit tests for the distribution_new_exponential function
bkjg Jul 29, 2020
923a41e
Start implementing tests form distribution_new_custom function
bkjg Jul 29, 2020
5c2551a
Add unit tests for the distribution_new_custom function
bkjg Jul 29, 2020
f603aa8
Add checking for not null in tests
bkjg Jul 30, 2020
b6fb8fd
Delete invalid tests
bkjg Jul 30, 2020
e5ad13b
Start implementing tests for distribution_clone function
bkjg Jul 30, 2020
e883c54
Add unit tests for the distribution_clone function
bkjg Jul 30, 2020
93cd883
Add unit tests for the distribution_average function
bkjg Jul 30, 2020
2770ba9
Add draft of unit tests for distribution_percentile function
bkjg Jul 30, 2020
2de7767
Add another unit tests for distribution_percentile function
bkjg Jul 30, 2020
faff4db
Add TODO
Jul 30, 2020
0caa54b
Implement getters functions
bkjg Jul 31, 2020
f8ce011
Move implementation of distribution_new_linear test to use getters
bkjg Jul 31, 2020
f714545
Move implementation of distribution_new_exponential and distribution_…
bkjg Jul 31, 2020
3b52335
Change signature of distribution_update function to int
bkjg Jul 31, 2020
36177a9
Fix heap buffer overflow error in bucket_update function
bkjg Aug 3, 2020
a568b19
Fix problems with getters and rename initial_size to base
bkjg Aug 4, 2020
3950d11
Implement tests for distribution_update and distribution_get_num_buckets
bkjg Aug 4, 2020
567ca20
Merge remote-tracking branch 'origin/distribution-metrics' into distr…
bkjg Aug 4, 2020
6e94531
Implement tests for distribution_get_buckets_boundaries
bkjg Aug 4, 2020
61caf83
Fix bugs in distribution_get_buckets_boundaries function
bkjg Aug 4, 2020
6d4afb2
Implement tests for distribution_get_buckets_counters function
bkjg Aug 4, 2020
fcbe7f0
Implement tests for distribution_get_sum_gauges and distribution_chec…
bkjg Aug 4, 2020
557dbd3
Add checking errno inside unit tests
bkjg Aug 4, 2020
5ed12d8
Add condition to distribution_new_custom function
bkjg Aug 4, 2020
8abc56e
Clang format
bkjg Aug 4, 2020
0fb5f5d
Replace constant number with static const variable
bkjg Aug 4, 2020
4e2fedd
Remove distribution.c include in distribution_test.c file
bkjg Aug 4, 2020
15c47fd
Add getters to the distribution header file
bkjg Aug 4, 2020
44991a3
Remove creating libdistribution.la from Makefile.am
bkjg Aug 5, 2020
e0246de
Add distribution_benchmark to Makefile.am
bkjg Aug 5, 2020
350e9f5
Add benchmark
bkjg Aug 10, 2020
50cc412
Add bash script for running distribution_benchmark
bkjg Aug 10, 2020
286f762
Clang format
bkjg Aug 10, 2020
b8a3350
Little fixes in benchmark and in functions for the distribution_t str…
bkjg Aug 12, 2020
5c162bd
Add distribution_benchmark for the different types of distribution
bkjg Aug 12, 2020
06c542e
Change number of iterations in the benchmark
bkjg Aug 12, 2020
8e5f95b
Change steps in script for running benchmark
bkjg Aug 13, 2020
06a62fd
Started introducing checking nulls in tests
bkjg Aug 13, 2020
17385fa
Move checking the custom buckets boundaries before allocating buckets
bkjg Aug 13, 2020
cb6c55d
Add comments about buckets' boundaries
bkjg Aug 13, 2020
e77c4bd
Add comments to the header file
bkjg Aug 13, 2020
7e3ad57
Fix returning NAN in distribution_average if there was no updates
bkjg Aug 13, 2020
9608d1b
Add checking nulls to the distribution_test
bkjg Aug 13, 2020
16af7af
Add two corner cases to tests for distribution_new_exponential function
bkjg Aug 13, 2020
2926727
Add unlocking mutexes in case on failure in distribution_check_equal …
bkjg Aug 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ sbin_PROGRAMS = \
bin_PROGRAMS = \
collectd-nagios \
collectd-tg \
collectdctl
collectdctl \
distribution_benchmark
endif # BUILD_WIN32


Expand Down Expand Up @@ -151,6 +152,7 @@ check_LTLIBRARIES = \

check_PROGRAMS = \
test_common \
test_distribution \
test_format_graphite \
test_meta_data \
test_metric \
Expand Down Expand Up @@ -356,6 +358,17 @@ test_meta_data_SOURCES = \
src/testing.h
test_meta_data_LDADD = libmetadata.la libplugin_mock.la

test_distribution_SOURCES = \
src/daemon/distribution_test.c \
src/testing.h
test_distribution_LDADD = libmetric.la libplugin_mock.la

distribution_benchmark_SOURCES = \
src/daemon/distribution_benchmark.c

distribution_benchmark_LDADD = \
libmetric.la

test_metric_SOURCES = \
src/daemon/metric_test.c \
src/testing.h
Expand Down Expand Up @@ -426,6 +439,8 @@ libmetadata_la_SOURCES = \
src/utils/metadata/meta_data.h

libmetric_la_SOURCES = \
src/daemon/distribution.c \
src/daemon/distribution.h \
src/daemon/metric.c \
src/daemon/metric.h
libmetric_la_LIBADD = libmetadata.la $(COMMON_LIBS)
Expand Down
6 changes: 6 additions & 0 deletions run_benchmark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

for i in {1..4000..50}
do
./distribution_benchmark $i
done
Loading