-
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.
* Have index in FlushTimer event * Fix test to use TimerFlush with index * ignore tags and vscode * Turn off debugging prints * will not introduce a new global constant here * Remove trailing whitespaces * Apply diff to config * Apply other commits from flush-interval * Last part * Fix problems * compiles * flush interval in all the sinks * removed flush_interval from null sink * Round out the flush-intervals work This commit pushes the flush intervals work that Ivan's been doing over the edge to completion. In particular, we now support: * per-sink configurable flush_intervals, plus a global default * guaranteed receive-once timer ticks The later is done by including an every-increasing value into TimerFlushes which allow duplicates -- because of paths in routing -- to be scrubbed out and ignored. An example configuration is added at examples/configs/counting-example.toml to let users fiddle with flush intervals. keep_count.lua has been promoted to help in that effort. This resolves #196. This resolves #74. Signed-off-by: Brian L. Troutwine <blt@postmates.com> * Remove the configurable interval from FlushTimer It occurred to me that explaining the difference of the global flush-timer as anything other than a default for sinks was confusing and that I might as well make FlushTimer tick once per second, hard-coded. Turns out that had been done by Ivan already so I just kindly smoothed things out. Signed-off-by: Brian L. Troutwine <blt@postmates.com>
- Loading branch information
Showing
18 changed files
with
248 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ target/ | |
src/metrics/statsd.rs | ||
src/metrics/graphite.rs | ||
*.bk | ||
/tags | ||
/.vscode |
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,23 @@ | ||
data-directory = "data/" | ||
scripts-directory = "examples/scripts/" | ||
|
||
flush-interval = 1 | ||
|
||
[tags] | ||
source = "cernan" | ||
|
||
[sources] | ||
[sources.statsd.primary] | ||
enabled = true | ||
port = 8125 | ||
forwards = ["filters.keep_count"] | ||
|
||
[filters] | ||
[filters.keep_count] | ||
script = "keep_count.lua" | ||
forwards = ["sinks.console"] | ||
|
||
[sinks] | ||
[sinks.console] | ||
bin_width = 1 | ||
flush_interval = 2 |
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,15 @@ | ||
count_per_tick = 0 | ||
|
||
function process_metric(pyld) | ||
count_per_tick = count_per_tick + 1 | ||
end | ||
|
||
function process_log(pyld) | ||
count_per_tick = count_per_tick + 1 | ||
end | ||
|
||
function tick(pyld) | ||
payload.push_metric(pyld, "count_per_tick", count_per_tick) | ||
payload.push_log(pyld, string.format("count_per_tick: %s", count_per_tick)) | ||
count_per_tick = 0 | ||
end |
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
Oops, something went wrong.