mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
promql: use explicit type declare instead of string. (#7716)
Signed-off-by: johncming <johncming@yahoo.com>
This commit is contained in:
parent
1c1b394e5e
commit
31929b83d5
|
@ -24,20 +24,20 @@ type ValueType string
|
|||
|
||||
// The valid value types.
|
||||
const (
|
||||
ValueTypeNone = "none"
|
||||
ValueTypeVector = "vector"
|
||||
ValueTypeScalar = "scalar"
|
||||
ValueTypeMatrix = "matrix"
|
||||
ValueTypeString = "string"
|
||||
ValueTypeNone ValueType = "none"
|
||||
ValueTypeVector ValueType = "vector"
|
||||
ValueTypeScalar ValueType = "scalar"
|
||||
ValueTypeMatrix ValueType = "matrix"
|
||||
ValueTypeString ValueType = "string"
|
||||
)
|
||||
|
||||
// DocumentedType returns the internal type to the equivalent
|
||||
// user facing terminology as defined in the documentation.
|
||||
func DocumentedType(t ValueType) string {
|
||||
switch t {
|
||||
case "vector":
|
||||
case ValueTypeVector:
|
||||
return "instant vector"
|
||||
case "matrix":
|
||||
case ValueTypeMatrix:
|
||||
return "range vector"
|
||||
default:
|
||||
return string(t)
|
||||
|
|
Loading…
Reference in a new issue