-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New config options for dogstatsd generation (#666)
* [does not build] refactor dogstatsd load generator * Fixes remaining build issues, almost works now * Incorrect use of choose_or_not * Update comments and correct multi-value bound * Satisfy clippy, make a `lading_rev` optimization target This commit satisfies clippy in a handful of areas but most importantly adds a `lading_rev` binary to the project. This binary will only be compiled when the `dogstatsd_perf` feature flag is added to the build and is meant to be used for optimizing the member generator. Of note, we've started to discuss streaming built `Member` instances direclty to a generator without going through a block cache. To this point we've assumed that the member generation only needs to be "fast enough", hence all the cloning and small string allocations and the like. The generator is _slow_ as a result. Consider that if you compile the project now with ``` > cargo build --release --features dogstatsd_perf --bin lading_rev ... > hyperfine Benchmark 1: ./target/release/lading_rev Time (mean ± σ): 32.688 s ± 3.813 s [User: 28.507 s, System: 2.650 s] Range (min … max): 30.190 s … 40.988 s 10 runs ``` Call it roughly 30ms per `Member` instance, an eternity. I'm working on a Mac so running ``` > cargo instruments --release --features dogstatsd_perf --bin lading_rev -t time ``` does appear to show that we spend _a lot_ of time making and cloning small strings, which is accurate to my understanding of the code as it exists today. `AsciiString` is a particular culprit. 67% of program runtime is in `impl payload::Generator<Tagsets>` as of this commit. Signed-off-by: Brian L. Troutwine <[email protected]> * Shave some runtime This commit removes the use of `choose_multiple` in the generator `AsciiString`. Profiling shows that in a run of `lading_rev` this generator is responsible for ~70% of program runtime. In _that_ ~60% of runtime is `choose_multiple`. While convenient, it does turn out that the function implicitly allocates a little `Vec` which we do not really need here, since we're immediately pushing into storage otherwise. ``` ➜ lading git:(sopell/dogstatsd-generator-revamp) ✗ hyperfine --warmup 3 ./target/release/lading_rev Benchmark 1: ./target/release/lading_rev Time (mean ± σ): 20.902 s ± 0.167 s [User: 18.438 s, System: 2.405 s] Range (min … max): 20.727 s … 21.279 s 10 runs ``` Shaves ~10 seconds off. Signed-off-by: Brian L. Troutwine <[email protected]> * tidy up after rebase Signed-off-by: Brian L. Troutwine <[email protected]> * re-add lading_rev, correct defaults Signed-off-by: Brian L. Troutwine <[email protected]> * Adds config knobs for min and max name length * Adds config knobs for tag key and tag value string length * Fix clippy useless conversion warning * Updates readme and dogstatsd example * Suppresses clippy warnings about too-many-arguments * Removes stale comment and debug build directive --------- Signed-off-by: Brian L. Troutwine <[email protected]> Co-authored-by: Brian L. Troutwine <[email protected]>
- Loading branch information
1 parent
6249fd5
commit 3a68e2e
Showing
16 changed files
with
717 additions
and
937 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
generator: | ||
- unix_datagram: | ||
seed: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, | ||
59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131] | ||
path: "/tmp/dsd.sock" | ||
variant: | ||
dogstatsd: | ||
contexts_minimum: 1000 | ||
contexts_maximum: 8000 | ||
tags_per_msg_minimum: 50 | ||
tags_per_msg_maximum: 71 | ||
multivalue_pack_probability: 1108 | ||
multivalue_count_minimum: 2 | ||
multivalue_count_maximum: 40 | ||
kind_weights: | ||
metric: 80 | ||
event: 10 | ||
service_check: 10 | ||
metric_weights: | ||
count: 100 | ||
gauge: 100 | ||
timer: 20 | ||
distribution: 100 | ||
set: 20 | ||
histogram: 20 | ||
bytes_per_second: "150 Mb" | ||
parallel_connections: 1 | ||
block_sizes: ["1Kb", "2Kb", "3Kb"] | ||
maximum_prebuild_cache_size_bytes: "50 Mb" | ||
|
||
blackhole: | ||
- http: | ||
binding_addr: "0.0.0.0:8089" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.