Skip to content
Snippets Groups Projects
Unverified Commit c97ff90a authored by github-automation-metabase's avatar github-automation-metabase Committed by GitHub
Browse files

limit the anon stats on query execution to 30 days (#46560) (#46811)


Co-authored-by: default avatarNgoc Khuat <qn.khuat@gmail.com>
parent c87df66a
No related branches found
No related tags found
No related merge requests found
......@@ -362,6 +362,8 @@
;;; Execution Metrics
(def ^:private query-execution-window-days 30)
(defn- summarize-executions
"Summarize `executions`, by incrementing approriate counts in a summary map."
([]
......@@ -369,7 +371,8 @@
[:= :error nil ] false
[:= :error "" ] false
:else true] :has_error]]
:from [:query_execution]})))
:from [:query_execution]
:where [:> :started_at (t/minus (t/offset-date-time) (t/days query-execution-window-days))]})))
([executions]
(reduce summarize-executions {:executions 0, :by_status {}, :num_per_user {}, :num_by_latency {}} executions))
([summary execution]
......
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