|
|
@ -117,6 +117,8 @@ type Query interface {
|
|
|
|
Stats() *stats.QueryTimers
|
|
|
|
Stats() *stats.QueryTimers
|
|
|
|
// Cancel signals that a running query execution should be aborted.
|
|
|
|
// Cancel signals that a running query execution should be aborted.
|
|
|
|
Cancel()
|
|
|
|
Cancel()
|
|
|
|
|
|
|
|
// String returns the original query string.
|
|
|
|
|
|
|
|
String() string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// query implements the Query interface.
|
|
|
|
// query implements the Query interface.
|
|
|
@ -141,10 +143,17 @@ type query struct {
|
|
|
|
type QueryOrigin struct{}
|
|
|
|
type QueryOrigin struct{}
|
|
|
|
|
|
|
|
|
|
|
|
// Statement implements the Query interface.
|
|
|
|
// Statement implements the Query interface.
|
|
|
|
|
|
|
|
// Calling this after Exec may result in panic,
|
|
|
|
|
|
|
|
// see https://github.com/prometheus/prometheus/issues/8949.
|
|
|
|
func (q *query) Statement() parser.Statement {
|
|
|
|
func (q *query) Statement() parser.Statement {
|
|
|
|
return q.stmt
|
|
|
|
return q.stmt
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// String implements the Query interface.
|
|
|
|
|
|
|
|
func (q *query) String() string {
|
|
|
|
|
|
|
|
return q.q
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Stats implements the Query interface.
|
|
|
|
// Stats implements the Query interface.
|
|
|
|
func (q *query) Stats() *stats.QueryTimers {
|
|
|
|
func (q *query) Stats() *stats.QueryTimers {
|
|
|
|
return q.stats
|
|
|
|
return q.stats
|
|
|
|