Changed package structure

This commit is contained in:
matthias@arch 2023-05-15 23:56:49 +02:00
parent 81ade4df38
commit 18e0cf1990
8 changed files with 24 additions and 5 deletions

1
.gitignore vendored
View File

@ -3,4 +3,3 @@ test/
*__pycache__*
build/
regina.egg-info/
regina/test/

View File

@ -1,4 +1,2 @@
"""Gather analytics from nginx access logs and visualize them through generated images and a generated html"""
# __package__ = 'regina'
from regina import database
"""Gather analytics from nginx access logs and visualize them through generated plots and a generated html"""
from regina.database import Database

View File

@ -0,0 +1 @@
"""log parsing"""

View File

@ -0,0 +1,13 @@
-- unused
SELECT ci.name,COUNT(v.visitor_id)
FROM city as ci, visitor as v, ip_range as i
WHERE ci.city_id = i.city_id
AND i.ip_range_id = v.ip_range_id
AND EXISTS(
SELECT 1
FROM request AS r
WHERE r.visitor_id = v.visitor_id
AND r.time BETWEEN {timestamps[0]} AND {timestamps[1]}
)
GROUP BY ci.name
ORDER BY COUNT(v.visitor_id)

8
regina/sql/country.sql Normal file
View File

@ -0,0 +1,8 @@
-- unused
SELECT co.name,COUNT(v.visitor_id)
FROM country as co, city as ci, visitor as v, ip_range as i
WHERE co.country_id = ci.country_id
AND ci.city_id = i.city_id
AND i.ip_range_id = v.ip_range_id
GROUP BY co.name
ORDER BY COUNT(v.visitor_id)