Dev (#2338)
* refactor(chalice): upgraded dependencies * refactor(chalice): upgraded dependencies feat(chalice): support heatmaps * feat(chalice): support table-of-browsers showing user-count * feat(chalice): support table-of-devices showing user-count * feat(chalice): support table-of-URLs showing user-count * fix(chalice): fixed Math-operators validation refactor(chalice): search for sessions that have events for heatmaps * refactor(chalice): search for sessions that have at least 1 location event for heatmaps * fix(chalice): fixed card-tableOf pagination
This commit is contained in:
parent
ecec4d8fd7
commit
111dc0db0b
2 changed files with 11 additions and 3 deletions
|
|
@ -329,6 +329,10 @@ def search2_table(data: schemas.SessionsSearchPayloadSchema, project_id: int, de
|
|||
full_args["step_size"] = step_size
|
||||
with pg_client.PostgresClient() as cur:
|
||||
if isinstance(metric_of, schemas.MetricOfTable):
|
||||
full_args["limit"] = data.limit
|
||||
full_args["limit_s"] = (data.page - 1) * data.limit
|
||||
full_args["limit_e"] = data.page * data.limit
|
||||
|
||||
main_col = "user_id"
|
||||
extra_col = ""
|
||||
extra_where = ""
|
||||
|
|
@ -356,7 +360,9 @@ def search2_table(data: schemas.SessionsSearchPayloadSchema, project_id: int, de
|
|||
if metric_format == schemas.MetricExtendedFormatType.session_count:
|
||||
main_query = f"""SELECT COUNT(*) AS count,
|
||||
COALESCE(SUM(users_sessions.session_count),0) AS total_sessions,
|
||||
COALESCE(JSONB_AGG(users_sessions) FILTER ( WHERE rn <= 200 ), '[]'::JSONB) AS values
|
||||
COALESCE(JSONB_AGG(users_sessions)
|
||||
FILTER ( WHERE rn > %(limit_s)s
|
||||
AND rn <= %(limit_e)s ), '[]'::JSONB) AS values
|
||||
FROM (SELECT {main_col} AS name,
|
||||
count(DISTINCT session_id) AS session_count,
|
||||
ROW_NUMBER() OVER (ORDER BY count(full_sessions) DESC) AS rn
|
||||
|
|
|
|||
|
|
@ -408,9 +408,11 @@ def search2_table(data: schemas.SessionsSearchPayloadSchema, project_id: int, de
|
|||
full_args["step_size"] = step_size
|
||||
sessions = []
|
||||
with ch_client.ClickHouseClient() as cur:
|
||||
full_args["limit_s"] = 0
|
||||
full_args["limit_e"] = 200
|
||||
if isinstance(metric_of, schemas.MetricOfTable):
|
||||
full_args["limit"] = data.limit
|
||||
full_args["limit_s"] = (data.page - 1) * data.limit
|
||||
full_args["limit_e"] = data.page * data.limit
|
||||
|
||||
main_col = "user_id"
|
||||
extra_col = "s.user_id"
|
||||
extra_where = ""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue