Switch to snippet-based reports
This commit is contained in:
parent
da330a6058
commit
ab2af1015a
6 changed files with 97 additions and 106 deletions
10
README.md
10
README.md
|
@ -3,7 +3,7 @@ Per-domain Nginx log analytics with hybrid static reports and live insights.
|
|||
|
||||
## Generating Reports
|
||||
|
||||
Use the `generate_reports.py` script to build aggregated JSON and HTML files from `database/ngxstat.db`.
|
||||
Use the `generate_reports.py` script to build aggregated JSON and HTML snippet files from `database/ngxstat.db`.
|
||||
|
||||
Create a virtual environment and install dependencies:
|
||||
|
||||
|
@ -34,7 +34,7 @@ python scripts/generate_reports.py hourly --domain example.com
|
|||
python scripts/generate_reports.py weekly --all-domains
|
||||
```
|
||||
|
||||
Reports are written under the `output/` directory. Each command updates the corresponding `<interval>.json` file and produces an HTML dashboard using Chart.js.
|
||||
Reports are written under the `output/` directory. Each command updates the corresponding `<interval>.json` file and writes one HTML snippet per report. These snippets are loaded dynamically by the main dashboard using Chart.js and DataTables.
|
||||
|
||||
### Configuring Reports
|
||||
|
||||
|
@ -44,8 +44,8 @@ and `value` columns. The special token `{bucket}` is replaced with the
|
|||
appropriate SQLite `strftime` expression for each interval (hourly, daily,
|
||||
weekly or monthly) so that a single definition works across all durations.
|
||||
When `generate_reports.py` runs, every definition is executed for the requested
|
||||
interval and creates `output/<interval>/<name>.json` along with an HTML
|
||||
dashboard.
|
||||
interval and creates `output/<interval>/<name>.json` plus a small HTML snippet
|
||||
`output/<interval>/<name>.html` used by the dashboard.
|
||||
|
||||
Example snippet:
|
||||
|
||||
|
@ -85,7 +85,7 @@ Use the `run-reports.sh` script to run all report intervals in one step. The scr
|
|||
./run-reports.sh
|
||||
```
|
||||
|
||||
Running this script will create or update the hourly, daily, weekly and monthly reports under `output/`. It also detects all unique domains found in the database and writes per-domain reports to `output/domains/<domain>/<interval>` alongside the aggregate data.
|
||||
Running this script will create or update the hourly, daily, weekly and monthly reports under `output/`. It also detects all unique domains found in the database and writes per-domain reports to `output/domains/<domain>/<interval>` alongside the aggregate data. After generation, open `output/index.html` in your browser to browse the reports.
|
||||
|
||||
## Serving Reports with Nginx
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue