5 ms·
IMO this could benefit from using `collections.Counter` instead of `defaultdict(set)`.
by css 5y ago
IMO this could benefit from using `collections.Counter` instead of `defaultdict(set)`.
- masklinn 5y agoWith a `Counter` you would be counting each access from a given IP as a hit against a category, rather than counting the IP itsef. Currently if 4 clients hit one URL and 1 client hits 5 logparser will register 5 records in each category (unless they're classified as bots for browsers and systems). With a Counter, it'd be 9. Both informations could be accessible using a `defaultdict(Counter)` but I don't know how useful that would be to the people actually using logparser.