Skip to content
Snippets Groups Projects
Unverified Commit 749bb58c authored by Kyle Doherty's avatar Kyle Doherty
Browse files

Merge branch 'xray-admin-toggle' of github.com:metabase/metabase into xray-admin-toggle

parents d5e10361 b320b059
No related branches found
No related tags found
No related merge requests found
(ns metabase.api.x-ray
(:require [compojure.core :refer [GET PUT]]
[metabase.api.common :as api]
[metabase.feature-extraction.core :as fe]
[metabase.feature-extraction
[core :as fe]
[costs :as costs]]
[metabase.models
[card :refer [Card]]
[field :refer [Field]]
......@@ -190,7 +192,7 @@
"segment" "table"]])
(def ^:private Settings
{:xray-max-cost (s/enum "exact" "approximate" "extended")
{:xray-max-cost costs/MaxCostBundles
:enable-xrays s/Bool})
(api/defendpoint PUT "/settings"
......
......@@ -5,18 +5,21 @@
[schema.core :as s]))
(def MaxCost
"Schema for max-cost parameter."
"Schema for `max-cost` parameter."
{:computation (s/enum :linear :unbounded :yolo)
:query (s/enum :cache :sample :full-scan :joins)})
(def MaxCostBundles
"Predefined `max-cost` bundles."
(s/maybe (s/enum "exact" "approximate" "extended")))
(defsetting xray-max-cost
"Cap resorce expanditure for all x-rays. (exact, approximate, or extended)"
:type :string
:default "extended"
:setter (fn [new-value]
(when-not (nil? new-value)
(assert (contains? #{"exact" "approximate" "extended"} new-value)))
(setting/set-string! :max-cost new-value)))
(s/validate MaxCostBundles new-value)
(setting/set-string! :xray-max-cost new-value)))
(defsetting enable-xrays
"Should x-raying be available at all?"
......
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