db/stats_gw: Remove accumulated gateway stats after 30 days

Accumulated gateway stats are much less accurate and helpful than
those for hoods or the global ones. Since they however account for
most of the global stats data, reduce their history in patch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2019-10-11 18:53:14 +02:00
parent 0dc1d81064
commit fc910c868e
2 changed files with 2 additions and 1 deletions

View File

@ -22,6 +22,7 @@ CONFIG = {
"event_num_entries": 300, # Number of events stored per router
"global_stat_days": 365, # Global/hood stats are collected for X days
"global_stat_show_days": 60, # Global/hood stats are shown for X days
"global_gwstat_days": 30, # Accumulated gateway stats are collected for X days
"csv_dir": "/var/lib/ffmap/csv", # Directory where the .csv files for TileStache/mapnik are stored
"debug_dir": "/data/fff/fffmonlog", # Output directory for debug .txt files
}

View File

@ -483,7 +483,7 @@ def record_hood_stats(mysql):
mysql.commit()
def record_gw_stats(mysql):
threshold=(utcnow() - datetime.timedelta(days=CONFIG["global_stat_days"])).timestamp()
threshold=(utcnow() - datetime.timedelta(days=CONFIG["global_gwstat_days"])).timestamp()
time = mysql.utctimestamp()
status = router_status_gw(mysql)
clients = total_clients_gw(mysql)