Mercurial > lbo > hg > analyrics
changeset 62:569284182390
Fix tz offset in requests per session
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Sun, 24 Jul 2022 21:32:20 -0700 |
parents | 51ea67f319e3 |
children | b0ad92c96f60 |
files | src/logsdb.rs |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/logsdb.rs Sat Jul 23 07:56:46 2022 -0700 +++ b/src/logsdb.rs Sun Jul 24 21:32:20 2022 -0700 @@ -263,14 +263,14 @@ r#" SELECT d, CAST(nreq AS REAL)/nses FROM - (SELECT DATE(atime, 'unixepoch') AS d, + (SELECT DATE(atime+?, 'unixepoch') AS d, COUNT(*) AS nreq FROM RequestLog JOIN Sessions ON (Sessions.id = RequestLog.session) WHERE atime+? > ? AND atime+? < ? AND RequestLog.domain LIKE ? AND is_bot <= ? GROUP BY d) JOIN - (SELECT DATE(start, 'unixepoch') AS d2, + (SELECT DATE(start+?, 'unixepoch') AS d2, COUNT(*) as nses FROM Sessions WHERE start+? > ? AND start+? < ? AND Sessions.domain LIKE ? AND is_bot <= ? @@ -279,12 +279,14 @@ ORDER BY d ASC"#, ) .bind(tz_offset) + .bind(tz_offset) .bind(ctx.from.unix_timestamp()) .bind(tz_offset) .bind(ctx.to.unix_timestamp()) .bind(ctx.domain.as_ref().map(String::as_str).unwrap_or("%")) .bind(include_bots) .bind(tz_offset) + .bind(tz_offset) .bind(ctx.from.unix_timestamp()) .bind(tz_offset) .bind(ctx.to.unix_timestamp())