-
Notifications
You must be signed in to change notification settings - Fork 71
Add method to explain query vector #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adds ExplainOutputNode struct with OperatorName and Children, A method `explainVector` generates `ExplainOutputNode` for the provided `VectorOperator`. This `explainVector` method is used by `Explain` method of query to get an explaination of the query. Signed-off-by: Pradyumna Krishna <git@onpy.in>
engine/engine.go
Outdated
| func explainVector(v model.VectorOperator) *ExplainOutputNode { | ||
| name, vectors := v.Explain() | ||
|
|
||
| var childs []ExplainOutputNode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| var childs []ExplainOutputNode | |
| var children []ExplainOutputNode |
engine/engine.go
Outdated
|
|
||
| var childs []ExplainOutputNode | ||
| for _, vector := range vectors { | ||
| childs = append(childs, *explainVector(vector)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can explainVector return nil?
GiedriusS
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could add some tests for this e.g. Explain() on a query that hasn't been executed yet, Explain() on a query that has one operator, Explain() on a "regular" query like sum(up) by (job).
Adds json key `name` to `OperatorName` and `children` to `Children` in `ExplainOutputNode`. Variable name correction in `explainVector` method. Signed-off-by: Pradyumna Krishna <git@onpy.in>
Test cases are added to Query Explain method to ensure working of the new query explain method. Signed-off-by: Pradyumna Krishna <git@onpy.in>
|
I guess the query |
I think we could use |
Calculate concurrencyOperators according to max available CPUs. Signed-off-by: Pradyumna Krishna <git@onpy.in>
Adds ExplainOutputNode struct with OperatorName and Children, A method
explainVectorgeneratesExplainOutputNodefor the providedVectorOperator.This
explainVectormethod is used byExplainmethod of query to get an explaination of the query.