Commit graph

442 commits

Author SHA1 Message Date
ppom
d8db2a1745
Add extensive test on Duplicate and fix related bug 2025-07-14 12:00:00 +02:00
ppom
6f346ff371
Test existing FilterManager tests for each Duplicate enum 2025-07-14 12:00:00 +02:00
ppom
81e5fb4c42
add State tests and fix trigger persistance
Triggers were only persisted for retry duration, instead of longuest
action duration.
As retry is often shorter than after, this would make reaction forget
most triggers on restart.
entry_timeout is now set to longuest_action_duration.
2025-07-14 12:00:00 +02:00
ppom
270a1a9bdf
Duplicate: Fix tests, more tests 2025-07-14 12:00:00 +02:00
ppom
d9842c2340
Duplicate::Extend: Re-Trigger only after actions
- implement schedule_exec's only_after
2025-07-14 12:00:00 +02:00
ppom
22384a2cb4
rename React::Exec to React::Trigger 2025-07-14 12:00:00 +02:00
ppom
2cebb733b5
WIP duplicates
- change remove_trigger to remove all triggers for a Match
- schedule_exec will take only_after boolean
2025-07-14 12:00:00 +02:00
ppom
881fc76bf9
WIP duplicates
- new duplicate option
- change triggers Tree structure to keep O(log(n)) querying:
  now we need to know if a match already has a trigger.
- triggers migration
- triggers adaptations in State & FilterManager
2025-07-14 12:00:00 +02:00
ppom
4ddaf6c195
v2.1.2 v2.1.2 2025-07-14 12:00:00 +02:00
ppom
b62f085e51
Fix trigger persistance
Triggers were only persisted for retry duration, instead of longuest
action duration.
As retry is often shorter than after, this would make reaction forget
most triggers on restart.
entry_timeout is now set to longuest_action_duration.

Cherry picked from the duplicate branch.
2025-07-14 12:00:00 +02:00
ppom
fd0dc91824
Get rid of useless Buffer wrapper for Vec<u8>
Write is already implemented on Vec<u8>
2025-07-11 12:00:00 +02:00
ppom
d880f7338b
Get rid of low-level async with Poll
use futures::stream::try_unfold to create a Stream from an async closure
2025-07-11 12:00:00 +02:00
ppom
e0609e3c3e
Move rewrite section 2025-07-08 12:00:00 +02:00
ppom
28f136f491
README update
project status update (rust rewrite ok)

contributing: separate ideas & code
2025-07-08 12:00:00 +02:00
ppom
5d9f2ceb6a
v2.1.1 v2.1.1 2025-07-07 12:00:00 +02:00
ppom
bba113b6ab
Remove newline at the end of stream lines
Bug introduced by !24 which kept trailing `\n` and fed it to filters.
Thus regexes ending with `$` couldn't match anymore.

Fixes #128
2025-07-07 12:00:00 +02:00
ppom
5bf67860f4
Fix Filter::regex for StreamManager::compiled_regex_set
regexes were pushed multiple times, with pattern names not completely
replaced by their corresponding regexes.
Now only pushed when pattern replacement is finished.
2025-07-07 12:00:00 +02:00
ppom
39bf662296
Fix example configs
- Fix comma issues
- Fix regex syntax doc
- Add ssh regexes
2025-06-28 12:00:00 +02:00
ppom
359957c58c
README: Add trigger command 2025-06-24 12:00:00 +02:00
ppom
3f3236cafb
v2.1.0 v2.1.0 2025-06-24 12:00:00 +02:00
ppom
78056b6fc5
src/client/request.rs rename and ARCHITECTURE.md update 2025-06-24 12:00:00 +02:00
ppom
6a778f3d01
cargo fmt, cargo clippy --all-targets 2025-06-24 12:00:00 +02:00
ppom
35862d32fa
Fix trigger command
- Force STREAM.FILTER one the command line
- Fix typo
2025-06-24 12:00:00 +02:00
ppom
283d1867b8
Benchmark: Add real-life configuration file and benchmark wrapper
Performance on this real-life configuration:

Before last commit:
Service runtime: 2min 22.669s
CPU time consumed: 3min 44.299s
Memory peak: 50.7M (swap: 0B)

With last commit:
Service runtime: 7.569s
CPU time consumed: 21.998s
Memory peak: 105.6M (swap: 0B)
2025-06-23 12:00:00 +02:00
ppom
ad6b0faa30
Performance: Use a RegexSet for all regexes of a Stream
StreamManager is now a struct that has its own RegexSet created from all
the regexes inside its Filters. Instead of calling
FilterManager::handle_line on all its FilterManagers, resulting in m*n
regex passes, it matches on all the regexes with its RegexSet.
It then only calls FilterManager::handle_line on matching Filters.

This should increase performance in those cases:
- Streams with a lot of filters or a lot of regexes
- Filters that match a small proportion of their Stream lines

This may decrease performance when most of lines are matched by all
Filters of a Stream.
2025-06-23 12:00:00 +02:00
ppom
55ed7b9c5f
Amend heavy-load test
- Add wrapper script
- Add non-matching lines
- Put two filters on the same stream, where either one of them matches
2025-06-23 12:00:00 +02:00
Baptiste Careil
d12a61c14a Fix #124: discard invalid utf8 sequences from input streams 2025-06-23 19:13:49 +00:00
Baptiste Careil
d4ffae8489 Fix #126: make config evaluation order predictable 2025-06-23 20:07:17 +02:00
ppom
529e40acd4
move State into its own file
This permit to reduce filter/mod.rs file size
2025-06-23 12:00:00 +02:00
ppom
39ae570ae5
rename file 2025-06-23 12:00:00 +02:00
ppom
4cb69fb0d4
Add test for trigger command 2025-06-23 12:00:00 +02:00
ppom
fad9ce1166
Add unit tests to FilterManager::handle_trigger 2025-06-23 12:00:00 +02:00
ppom
ff8ea60ce6
WIP trigger command and ignoreregex performance improvement
- ignoreregex is now a RegexSet for improved performance
- Vec::clear() replaced by new Vec to really free RAM
2025-06-23 12:00:00 +02:00
ppom
b0c307a9d2
WIP trigger command 2025-06-23 12:00:00 +02:00
ppom
731ad6ddfd
Simplify parse_duration tests by using appropriate units 2025-06-23 12:00:00 +02:00
ppom
0ff8fda607
cargo fmt, cargo clippy --all-targets 2025-06-17 12:00:00 +02:00
ppom
9963ef4192
Improve error message for retry < 2.
Fixes #125
2025-06-17 12:00:00 +02:00
ppom
ff84a31a7d
build: use CC env var if available. defaults to cc instead of gcc 2025-06-15 12:00:00 +02:00
ppom
0d9fc47016
Update duration format documentation
As it's no longer Go's format
2025-06-10 12:00:00 +02:00
ppom
5bccdb5ba7
Add oneshot option for actions
Fixes #92
2025-06-10 12:00:00 +02:00
ppom
cc38c55fdb
Add test-config subcommand to README 2025-06-06 12:00:00 +02:00
ppom
c04168d4dc
Fix outdated links in README 2025-06-06 12:00:00 +02:00
ppom
2e9e7a2a7b
Remove old go codebase 2025-06-06 12:00:00 +02:00
ppom
e642620ae3
Cross-compile C binaries too 2025-06-06 12:00:00 +02:00
ppom
8f5511b415
v2.0.1 2025-06-05 12:00:00 +02:00
ppom
388d4dac90
Fix tarball Makefile, release.py
- Makefile creates missing directories
- release.py puts tarballs & debs in local/ directory when not
  publishing
2025-06-05 12:00:00 +02:00
ppom
f63502759f
make official release only with --publish flag 2025-06-05 12:00:00 +02:00
ppom
74280d0f45
Fix completions filenames and their removal 2025-06-05 12:00:00 +02:00
Martin
8543fead54 Fix makefile install
remove duplicated /man/man1
otherwise, get an error during installation
install: target '/usr/local/share/man/man1/man/man1/': No such file or directory

Use -D to create missing directory
2025-06-05 16:52:09 +02:00
ppom
3beca6d7a5
Document state_directory
Fixes #71
2025-06-05 12:00:00 +02:00