aboutsummaryrefslogtreecommitdiff
path: root/src/filters.rs
AgeCommit message (Collapse)Author
2020-04-17split off player filters and log filtersDaniel
As it turns out, we can easily re-use the existing Filter machinery to generalize over LogFilters (which operate on LogResults) and PlayerFilters (which operate on Players). The feature trait_aliases is not strictly needed but makes the function signatures a bit nicer and easier to read, and it reduces the chances of an error (e.g. by using Filter<&PartialEvtc, ...>).
2020-04-15new filter pipelineDaniel
This is the groundwork for introducing more complex filter queries like `find` has. Filters can be arbitrarily combined with and/or/not and support an "early filter" mode. So far, the filters have been translated pretty mechanically to match the current command line arguments, so now new syntax has been introduced. The NameFilter is not yet in its final version. The goal is to support something like PlayerAll/PlayerExists and have a PlayerFilter that works on single players instead of the complete log, but that might introduce some code duplication as we then need a PlayerFilterAnd, PlayerFilterOr, ... Some digging has to be done into whether we can reduce that duplication without devolving into madness or resorting to macros. Maybe some type-level generic hackery could be done? Maybe an enum instead of dynamic traits should be used, at least for the base functions?
2020-04-09replace unwrap/match with if-letDaniel
2020-04-06implement guild display & filtering optionsDaniel
Filtering based on guilds is slow, as it will have to retrieve every guild name from the GW2 API, and it has to parse every log file instead of bailing early. Therefore, guilds are not searched by default, and have to be explicitely turned on with --guilds. In addition, this means that raidgrep will now need network access when --guilds is passed, which was not the case before.
2019-05-31add option to filter based on bossDaniel
2019-05-24lazily parse log eventsDaniel
A lot of time is spent parsing the actual log events, especially when they are zipped, as they have to be decompressed first. This results in huge run-time hits, especially for files where we could determine very early if we actually need it. For example, player names are saved in the header, which can be examined very quickly. If we can determine at that stage that a log file will not appear in the result set, we don't need to parse all the log events. This patch relies on the partial parsing support of evtclib to do exactly that. It parses only the header with the player names, and only if there's a match, it will proceed to parse the events and do more filtering. In the future, we can extend this even more, for example we can also check the boss ID that way, since we can also access that in the header. On the downside, we now have the zip handling logic replicated in raidgrep, as we want a "common" interface to extract the actual data stream. But this logic could be pushed back to evtclib after polishing it a bit. There are some problems with Rust's borrow checking though, which is why it looks a bit convoluted.
2019-05-18add support for weekday filteringDaniel
2019-02-16lint fixesDaniel
2019-02-16introduce CommaSeparatedListDaniel
This gives a common interface for command line flags which take multiple values, possibly with negation. This might come in useful if we add filtering by boss, e.g. "--boss !deimos" to ignore all deimos logs.
2018-10-15clippyDaniel
2018-10-15add time based filteringDaniel
This accepts timestamps in the following formats: * Human-readable, like "15d", taken relative to the current time. * rfc3339-like "2018-03-14 13:13:00" More formats might be added in the future.
2018-09-10move filtering into own submoduleDaniel