Skip to content
Snippets Groups Projects
Unverified Commit 4bd2c5b1 authored by Howon Lee's avatar Howon Lee Committed by GitHub
Browse files

Audit cards data display problem (#18527)

Underlying problem was that the cardinality of dates were getting limited by the default 1000 limit imposed by EE queries. Whack it for this specific instance. I think if we see it ever again we just remove the 1000 limit instead.
parent bef09e29
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,8 @@
[ring.util.codec :as codec]
[schema.core :as s]))
(def ^:private ^:const date-cardinality-limit 25000)
;; DEPRECATED Query that returns data for a two-series timeseries: the number of DAU (a User is considered active for
;; purposes of this query if they ran at least one query that day), and total number of queries ran. Broken out by
;; day.
......@@ -40,13 +42,15 @@
{:select [[(common/grouped-datetime datetime-unit :started_at) :date]
[:%distinct-count.executor_id :count]]
:from [:query_execution]
:group-by [(common/grouped-datetime datetime-unit :started_at)]})
:group-by [(common/grouped-datetime datetime-unit :started_at)]
:limit date-cardinality-limit})
date->active (zipmap (map :date active) (map :count active))
new (common/query
{:select [[(common/grouped-datetime datetime-unit :date_joined) :date]
[:%count.* :count]]
:from [:core_user]
:group-by [(common/grouped-datetime datetime-unit :date_joined)]})
:group-by [(common/grouped-datetime datetime-unit :date_joined)]
:limit date-cardinality-limit})
date->new (zipmap (map :date new) (map :count new))
all-dates (sort (keep identity (distinct (concat (keys date->active)
(keys date->new)))))]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment