Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
5aa18683
Commit
5aa18683
authored
7 years ago
by
Simon Belak
Browse files
Options
Downloads
Patches
Plain Diff
add card-table and card-segment comparison endpoints
parent
7268b842
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/api/x_ray.clj
+37
-2
37 additions, 2 deletions
src/metabase/api/x_ray.clj
with
37 additions
and
2 deletions
src/metabase/api/x_ray.clj
+
37
−
2
View file @
5aa18683
...
...
@@ -16,8 +16,7 @@
[
table
:refer
[
Table
]]]
[
schema.core
:as
s
]))
;; See metabase.feature-extraction.core/extract-features for description of
;; these settings.
;; See metabase.feature-extraction.core/costs for description of these settings.
(
def
^
:private
MaxQueryCost
(
s/maybe
(
s/enum
"cache"
"sample"
...
...
@@ -149,6 +148,42 @@
(
api/read-check
Segment
segment-id
)
(
api/read-check
Table
table-id
)))
(
api/defendpoint
GET
"/compare/card/:card-id/table/:table-id"
"Get comparison x-ray of a table and a card."
[
card-id
table-id
max_query_cost
max_computation_cost
]
{
max_query_cost
MaxQueryCost
max_computation_cost
MaxComputationCost
}
(
compare
(
max-cost
max_query_cost
max_computation_cost
)
(
api/read-check
Card
card-id
)
(
api/read-check
Table
table-id
)))
(
api/defendpoint
GET
"/compare/card/:card-id/segment/:segment-id"
"Get comparison x-ray of a card and a segment."
[
card-id
segment-id
max_query_cost
max_computation_cost
]
{
max_query_cost
MaxQueryCost
max_computation_cost
MaxComputationCost
}
(
compare
(
max-cost
max_query_cost
max_computation_cost
)
(
api/read-check
Card
card-id
)
(
api/read-check
Segment
segment-id
)))
(
api/defendpoint
GET
"/compare/segment/:segment-id/card/:card-id"
"Get comparison x-ray of a card and a segment."
[
segment-id
card-id
max_query_cost
max_computation_cost
]
{
max_query_cost
MaxQueryCost
max_computation_cost
MaxComputationCost
}
(
compare
(
max-cost
max_query_cost
max_computation_cost
)
(
api/read-check
Segment
segment-id
)
(
api/read-check
Card
card-id
)))
(
api/defendpoint
GET
"/compare/table/:table-id/card/:card-id"
"Get comparison x-ray of a table and a card."
[
table-id
card-id
max_query_cost
max_computation_cost
]
{
max_query_cost
MaxQueryCost
max_computation_cost
MaxComputationCost
}
(
compare
(
max-cost
max_query_cost
max_computation_cost
)
(
api/read-check
Table
table-id
)
(
api/read-check
Card
card-id
)))
(
api/defendpoint
POST
"/compare/card/:id/query"
"Get comparison x-ray of card and ad-hoc query."
[
id
max_query_cost
max_computation_cost
:as
{
query
:body
}]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment