Skip to content

Commit

Permalink
fix: filter vital from custom events on usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Bekacru committed Feb 10, 2024
1 parent 9d3e9e9 commit 781c14d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions apps/www/src/server/query/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ const getTotalEventsCount = async (websiteIds: string[], startDate: Date, endDat
query: `select * from loglib.event where websiteId IN (${websiteIds.map(w => `'${w}'`)}) AND timestamp >='${startDate.toISOString().slice(0, 19).replace("T", " ")}' AND timestamp <='${endDate.toISOString().slice(0, 19).replace("T", " ")}'`,
format: "JSONEachRow"
}).then(async (res) => await res.json() as { event: string }[])
console.log(sessionsCount.length, websiteIds)
return {
pageViews: sessionsCount.filter(s => s.event === "hits").length,
customEvents: sessionsCount.filter(s => s.event !== "hits").length
customEvents: sessionsCount.filter(s => s.event !== "hits" && s.event !== "vitals").length
}
},
sqlite: async () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/www/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"schedule": "0 12 * * *"
}
]
}
}

0 comments on commit 781c14d

Please sign in to comment.