mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
Updated date output for Clickhouse.
This commit is contained in:
parent
62f35668ae
commit
4494665d2e
6 changed files with 20 additions and 17 deletions
|
|
@ -24,7 +24,7 @@ async function relationalQuery(websiteId: string, filters: QueryFilters, pagePar
|
|||
}
|
||||
|
||||
async function clickhouseQuery(websiteId: string, filters: QueryFilters, pageParams?: PageParams) {
|
||||
const { pagedQuery, parseFilters } = clickhouse;
|
||||
const { pagedQuery, parseFilters, getDateStringSQL } = clickhouse;
|
||||
const { params, dateQuery, filterQuery } = await parseFilters(websiteId, filters);
|
||||
|
||||
return pagedQuery(
|
||||
|
|
@ -33,8 +33,7 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters, pagePar
|
|||
event_id as id,
|
||||
website_id as websiteId,
|
||||
session_id as sessionId,
|
||||
created_at as createdAt,
|
||||
toUnixTimestamp(created_at) as timestamp,
|
||||
${getDateStringSQL('created_at', 'second', filters.timezone)} as createdAt,
|
||||
url_path as urlPath,
|
||||
url_query as urlQuery,
|
||||
referrer_path as referrerPath,
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ export async function getRealtimeData(
|
|||
const { startDate, timezone } = criteria;
|
||||
const filters = { startDate, endDate: new Date(), unit: 'minute', timezone };
|
||||
const [events, sessions, pageviews, sessionviews] = await Promise.all([
|
||||
getEvents(websiteId, { startDate }, { pageSize: 10000 }),
|
||||
getSessions(websiteId, { startDate }, { pageSize: 10000 }),
|
||||
getEvents(websiteId, { startDate, timezone }, { pageSize: 10000 }),
|
||||
getSessions(websiteId, { startDate, timezone }, { pageSize: 10000 }),
|
||||
getPageviewStats(websiteId, filters),
|
||||
getSessionStats(websiteId, filters),
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ async function relationalQuery(websiteId: string, filters: QueryFilters, pagePar
|
|||
}
|
||||
|
||||
async function clickhouseQuery(websiteId: string, filters: QueryFilters, pageParams?: PageParams) {
|
||||
const { pagedQuery, parseFilters } = clickhouse;
|
||||
const { pagedQuery, parseFilters, getDateStringSQL } = clickhouse;
|
||||
const { params, dateQuery, filterQuery } = await parseFilters(websiteId, filters);
|
||||
|
||||
return pagedQuery(
|
||||
|
|
@ -32,8 +32,7 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters, pagePar
|
|||
select
|
||||
session_id as id,
|
||||
website_id as websiteId,
|
||||
created_at as createdAt,
|
||||
toUnixTimestamp(created_at) as timestamp,
|
||||
${getDateStringSQL('created_at', 'second', filters.timezone)} as createdAt,
|
||||
hostname,
|
||||
browser,
|
||||
os,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue