1
0

Optimize analytics queries (#781)

* Optimize analytics queries

* fix clippy
This commit is contained in:
Geometrically
2023-12-04 18:49:51 -07:00
committed by GitHub
parent 27055b96e3
commit 4630d175d7
11 changed files with 83 additions and 1095 deletions

View File

@@ -16,7 +16,6 @@ use std::collections::HashMap;
use std::net::{AddrParseError, IpAddr, Ipv4Addr, Ipv6Addr};
use std::sync::Arc;
use url::Url;
use uuid::Uuid;
pub const FILTERED_HEADERS: &[&str] = &[
"authorization",
@@ -107,7 +106,6 @@ pub async fn page_view_ingest(
.unwrap_or_else(|_| Ipv4Addr::new(127, 0, 0, 1).to_ipv6_mapped());
let mut view = PageView {
id: Uuid::new_v4(),
recorded: get_current_tenths_of_ms(),
domain: domain.to_string(),
site_path: url.path().to_string(),
@@ -203,7 +201,6 @@ pub async fn playtime_ingest(
if let Some(version) = versions.iter().find(|x| id == x.inner.id.into()) {
analytics_queue.add_playtime(Playtime {
id: Default::default(),
recorded: get_current_tenths_of_ms(),
seconds: playtime.seconds as u64,
user_id: user.id.0,