Skip to content

Commit 3bcc996

Browse files
authored
Summary sketch (#177)
This uses now ddskerl, an implementation of the DDSketch algorithm, instead of quantile_estimator, which is in turn an implementation of Cormode's biased algorithms. The most important difference is that the biased algorithms aren't mathematically mergeable, hence keeping a per-scheduler summary would never work, and keeping a single global one would never scale (and not mentioning race conditions on inserts as the data-structure is not possible to treat atomically in an ets table). Instead, the DDSketch algorithm is fully mergeable, and the data structure implementation has an ETS backend fully tested for all sorts of race conditions. As a possibility that is out of the scope of this PR, a custom exporter might provide the Sketch data structure to datadog, so that the quantile merges can be done on the server, and that way the metrics server can aggregate quantiles across many hosts in a meaningful way. ------- List of commits: * Optimise convert_du time helper * Reimplement summaries using ddskerl * Fix formatting tests * Make quantile summary table read_concurrent * Upgrade ddskerl * Introduce wide width to quantile summaries * Fix dependency starting functions * Avoid introducing breaking changes to default exported quantiles * Increase quantile summary test coverage * Fix gauge and coverage for prometheus_time:maybe_convert_to_du/2 * Fix helper called for quantile loop * Upgrade ddsketch * Support ddsketch bucketing when using histograms Note that DataDog supports exporting prometheus histograms as DataDog Distributions. * Optimise histograms * Fix bug with correctly converting to duration units * Simplify and unify loop_through_keys helper * Fix TODO in documentation for ddsketch buckets
1 parent 02df2e1 commit 3bcc996

14 files changed

+467
-318
lines changed

rebar.config

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
]}.
2121

2222
{deps, [
23-
{quantile_estimator, "1.0.2"}
23+
{ddskerl, "0.4.1"}
2424
]}.
2525
{shell, [{apps, [prometheus]}]}.
2626

@@ -36,13 +36,14 @@
3636

3737
{dialyzer, [
3838
{warnings, [no_return, error_handling, unknown]},
39-
{plt_extra_apps, [mnesia, quantile_estimator]}
39+
{plt_extra_apps, [mnesia]}
4040
]}.
4141

4242
{profiles, [
4343
{test, [
4444
{erl_opts, [nowarn_missing_spec]},
4545
{eunit_compile_opts, [{src_dirs, ["src", "test/eunit"]}]},
46+
{eunit_opts, [verbose]},
4647
{covertool, [{coverdata_files, ["ct.coverdata"]}]},
4748
{cover_opts, [verbose, {min_coverage, 95}]},
4849
{cover_enabled, true},
@@ -129,7 +130,8 @@
129130
]
130131
}},
131132
{elvis_style, god_modules, #{limit => 40}},
132-
{elvis_style, dont_repeat_yourself, #{min_complexity => 15}}
133+
{elvis_style, dont_repeat_yourself, #{min_complexity => 15}},
134+
{elvis_style, no_catch_expressions, disable}
133135
],
134136
ruleset => erl_files
135137
},

rebar.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{"1.2.0",
2-
[{<<"quantile_estimator">>,{pkg,<<"quantile_estimator">>,<<"1.0.2">>},0}]}.
2+
[{<<"ddskerl">>,{pkg,<<"ddskerl">>,<<"0.4.1">>},0}]}.
33
[
44
{pkg_hash,[
5-
{<<"quantile_estimator">>, <<"ECD281D40110FDD9BA62685531E4435E0839A52FD1058DA5564F1763E4642EF7">>}]},
5+
{<<"ddskerl">>, <<"F0329E1F8FD3C6209F1645B540F6D4FC14C60B897B05E65B8A4122A362EF019A">>}]},
66
{pkg_hash_ext,[
7-
{<<"quantile_estimator">>, <<"DB404793D6384995A1AC6DD973E2CEE5BE9FCC128765BDBA53D87C564E296B64">>}]}
7+
{<<"ddskerl">>, <<"0B68A1E53AF4CCF5F43D70F8EABA1F031388B3FCBD6405FA0CDF849FB47F1811">>}]}
88
].

0 commit comments

Comments
 (0)