forked from wvanbergen/request-log-analyzer
/
DESIGN
38 lines (28 loc) · 1.87 KB
/
DESIGN
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Request-log-analyzer is set up like a simple pipe and filter system.
This allows you to easily add extra reports, filters and outputs.
1) Build pipeline.
-> Aggregator (database)
Source -> Filter -> Filter -> Aggregator (summary report) -> Output
-> Aggregator (...)
2) Start chunk producer and push chunks through pipeline.
Controller.start
RequestLogAnalyzer::Source is an Object that pushes requests into the chain.
At the moment you can only use the log-parser as a source.
It accepts files or stdin and can parse then into request objects using a RequestLogAnalyzer::FileFormat definition.
In the future we want to be able to have a generated request database as source as this will make interactive
down drilling possible.
The filters are all subclasses of the RequestLogAnalyzer::Filter class.
They accept a request object, manipulate or drop it, and then pass the request object on to the next filter
in the chain.
At the moment there are three types of filters available: Anonymize, Field and Timespan.
The Aggregators all inherit from the RequestLogAnalyzer::Aggregator class.
All the requests that come out of the Filterchain are fed into all the aggregators in parallel.
These aggregators can do anything what they want with the given request.
For example: the Database aggregator will just store all the requests into a SQLite database while the Summarizer will
generate a wide range of statistical reports from them.
3) Gather output from pipeline.
Controller.report
All Aggregators are asked to report what they have done. For example the database will report: I stuffed x requests
into SQLite database Y. The Summarizer will output its reports.
The output is pushed to a RequestLogAnalyzer::Output object, which takes care of the output.
It can generate either ASCII, UTF8 or even HTML output.