2020-09-10 23:28:19 +02:00
|
|
|
// Code generated by qtc from "metrics_find_response.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:1
|
|
|
|
package graphite
|
|
|
|
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:1
|
|
|
|
import (
|
2020-09-29 17:00:28 +02:00
|
|
|
"sort"
|
2020-09-10 23:28:19 +02:00
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
|
|
|
|
)
|
|
|
|
|
|
|
|
// MetricsFindResponse generates response for /metrics/find .See https://graphite-api.readthedocs.io/en/latest/api.html#metrics-find
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:12
|
2020-09-10 23:28:19 +02:00
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:12
|
2020-09-10 23:28:19 +02:00
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:12
|
2020-09-29 17:00:28 +02:00
|
|
|
func StreamMetricsFindResponse(qw422016 *qt422016.Writer, paths []string, delimiter, format string, addWildcards bool, jsonp string) {
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:13
|
2020-09-10 23:28:19 +02:00
|
|
|
if jsonp != "" {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:13
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(jsonp)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:13
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`(`)
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:13
|
2020-09-29 17:00:28 +02:00
|
|
|
}
|
2020-09-10 23:28:19 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:14
|
2020-09-29 17:00:28 +02:00
|
|
|
switch format {
|
2020-09-10 23:28:19 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:15
|
2020-09-29 17:00:28 +02:00
|
|
|
case "completer":
|
2020-09-10 23:28:19 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:16
|
2020-09-29 17:00:28 +02:00
|
|
|
streammetricsFindResponseCompleter(qw422016, paths, delimiter, addWildcards)
|
2020-09-10 23:28:19 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:17
|
2020-09-29 17:00:28 +02:00
|
|
|
case "treejson":
|
2020-09-10 23:28:19 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:18
|
2020-09-29 17:00:28 +02:00
|
|
|
streammetricsFindResponseTreeJSON(qw422016, paths, delimiter, addWildcards)
|
2020-09-10 23:28:19 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:19
|
2020-09-29 17:00:28 +02:00
|
|
|
default:
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:20
|
2020-09-10 23:28:19 +02:00
|
|
|
logger.Panicf("BUG: unexpected format=%q", format)
|
|
|
|
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:21
|
2020-09-29 17:00:28 +02:00
|
|
|
}
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:22
|
2020-09-10 23:28:19 +02:00
|
|
|
if jsonp != "" {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:22
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`)`)
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:22
|
2020-09-29 17:00:28 +02:00
|
|
|
}
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:23
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:23
|
2020-09-10 23:28:19 +02:00
|
|
|
func WriteMetricsFindResponse(qq422016 qtio422016.Writer, paths []string, delimiter, format string, addWildcards bool, jsonp string) {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:23
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:23
|
2020-09-10 23:28:19 +02:00
|
|
|
StreamMetricsFindResponse(qw422016, paths, delimiter, format, addWildcards, jsonp)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:23
|
2020-09-10 23:28:19 +02:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:23
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:23
|
2020-09-10 23:28:19 +02:00
|
|
|
func MetricsFindResponse(paths []string, delimiter, format string, addWildcards bool, jsonp string) string {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:23
|
2020-09-10 23:28:19 +02:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:23
|
2020-09-10 23:28:19 +02:00
|
|
|
WriteMetricsFindResponse(qb422016, paths, delimiter, format, addWildcards, jsonp)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:23
|
2020-09-10 23:28:19 +02:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:23
|
2020-09-10 23:28:19 +02:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:23
|
2020-09-10 23:28:19 +02:00
|
|
|
return qs422016
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:23
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:25
|
2020-09-10 23:28:19 +02:00
|
|
|
func streammetricsFindResponseCompleter(qw422016 *qt422016.Writer, paths []string, delimiter string, addWildcards bool) {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:25
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`{"metrics":[`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:28
|
2020-09-10 23:28:19 +02:00
|
|
|
for i, path := range paths {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:28
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`{"path":`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:30
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().Q(path)
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:30
|
2020-09-29 17:00:28 +02:00
|
|
|
qw422016.N().S(`,"name":`)
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:31
|
2020-09-10 23:28:19 +02:00
|
|
|
streammetricPathName(qw422016, path, delimiter)
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:31
|
2020-09-29 17:00:28 +02:00
|
|
|
qw422016.N().S(`,"is_leaf":`)
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:32
|
2020-09-10 23:28:19 +02:00
|
|
|
if strings.HasSuffix(path, delimiter) {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:32
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`0`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:32
|
2020-09-10 23:28:19 +02:00
|
|
|
} else {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:32
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`1`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:32
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:32
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`}`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:34
|
2020-09-10 23:28:19 +02:00
|
|
|
if i+1 < len(paths) {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:34
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`,`)
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:34
|
2020-09-29 17:00:28 +02:00
|
|
|
}
|
2020-09-10 23:28:19 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:35
|
2020-09-29 17:00:28 +02:00
|
|
|
}
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:36
|
2020-09-10 23:28:19 +02:00
|
|
|
if addWildcards && len(paths) > 1 {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:36
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`,{"name": "*"}`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:40
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:40
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`]}`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:43
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:43
|
2020-09-10 23:28:19 +02:00
|
|
|
func writemetricsFindResponseCompleter(qq422016 qtio422016.Writer, paths []string, delimiter string, addWildcards bool) {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:43
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:43
|
2020-09-10 23:28:19 +02:00
|
|
|
streammetricsFindResponseCompleter(qw422016, paths, delimiter, addWildcards)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:43
|
2020-09-10 23:28:19 +02:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:43
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:43
|
2020-09-10 23:28:19 +02:00
|
|
|
func metricsFindResponseCompleter(paths []string, delimiter string, addWildcards bool) string {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:43
|
2020-09-10 23:28:19 +02:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:43
|
2020-09-10 23:28:19 +02:00
|
|
|
writemetricsFindResponseCompleter(qb422016, paths, delimiter, addWildcards)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:43
|
2020-09-10 23:28:19 +02:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:43
|
2020-09-10 23:28:19 +02:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:43
|
2020-09-10 23:28:19 +02:00
|
|
|
return qs422016
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:43
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:45
|
2020-09-10 23:28:19 +02:00
|
|
|
func streammetricsFindResponseTreeJSON(qw422016 *qt422016.Writer, paths []string, delimiter string, addWildcards bool) {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:45
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`[`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:48
|
|
|
|
if len(paths) > 1 {
|
|
|
|
sort.Strings(paths)
|
|
|
|
// Substitute `path` and `path<delimiter>` with `path<delimiter><delimiter>`.
|
|
|
|
// Such path is treated specially during rendering - see code below for details.
|
|
|
|
dst := paths[:1]
|
|
|
|
for _, path := range paths[1:] {
|
|
|
|
prevPath := dst[len(dst)-1]
|
|
|
|
if len(path) == len(prevPath)+1 && strings.HasSuffix(path, delimiter) && strings.HasPrefix(path, prevPath) {
|
|
|
|
// The path is equivalent to <prevPath> + <delimiter>
|
|
|
|
// Overwrite the prevPath with <path> + <delimiter> as carbonapi does.
|
|
|
|
// I.e. the resulting path ends with double delimiter.
|
|
|
|
// Such path is treated specially during rendering - see metrics_find_response.qtpl for details.
|
|
|
|
dst[len(dst)-1] = path + delimiter
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
dst = append(dst, path)
|
|
|
|
}
|
|
|
|
paths = dst
|
|
|
|
}
|
|
|
|
|
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:68
|
2020-09-10 23:28:19 +02:00
|
|
|
for i, path := range paths {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:68
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`{`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:71
|
2020-09-29 10:00:41 +02:00
|
|
|
id := path
|
2020-09-10 23:28:19 +02:00
|
|
|
allowChildren := "0"
|
|
|
|
isLeaf := "1"
|
2020-09-29 10:00:41 +02:00
|
|
|
if strings.HasSuffix(id, delimiter) {
|
|
|
|
if strings.HasSuffix(id[:len(id)-1], delimiter) {
|
|
|
|
// Special case when id ends with double delimiter.
|
2020-09-29 17:00:28 +02:00
|
|
|
// See the code above for details.
|
2020-09-29 10:00:41 +02:00
|
|
|
id = id[:len(id)-2]
|
|
|
|
}
|
2020-09-10 23:28:19 +02:00
|
|
|
allowChildren = "1"
|
|
|
|
isLeaf = "0"
|
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:83
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`"id":`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:84
|
2020-09-29 10:00:41 +02:00
|
|
|
qw422016.N().Q(id)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:84
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`,"text":`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:85
|
2020-09-10 23:28:19 +02:00
|
|
|
streammetricPathName(qw422016, path, delimiter)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:85
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`,"allowChildren":`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:86
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(allowChildren)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:86
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`,"expandable":`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:87
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(allowChildren)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:87
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`,"leaf":`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:88
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(isLeaf)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:88
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`}`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:90
|
2020-09-10 23:28:19 +02:00
|
|
|
if i+1 < len(paths) {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:90
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`,`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:90
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:91
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:92
|
2020-09-10 23:28:19 +02:00
|
|
|
if addWildcards && len(paths) > 1 {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:92
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`,{`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:95
|
2020-09-10 23:28:19 +02:00
|
|
|
path := paths[0]
|
|
|
|
for strings.HasSuffix(path, delimiter) {
|
|
|
|
path = path[:len(path)-1]
|
|
|
|
}
|
|
|
|
id := ""
|
|
|
|
if n := strings.LastIndexByte(path, delimiter[0]); n >= 0 {
|
|
|
|
id = path[:n+1]
|
|
|
|
}
|
|
|
|
id += "*"
|
|
|
|
|
|
|
|
allowChildren := "0"
|
|
|
|
isLeaf := "1"
|
|
|
|
for _, path := range paths {
|
|
|
|
if strings.HasSuffix(path, delimiter) {
|
|
|
|
allowChildren = "1"
|
|
|
|
isLeaf = "0"
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:114
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`"id":`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:115
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().Q(id)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:115
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`,"text": "*","allowChildren":`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:117
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(allowChildren)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:117
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`,"expandable":`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:118
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(allowChildren)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:118
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`,"leaf":`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:119
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(isLeaf)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:119
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`}`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:121
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:121
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().S(`]`)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:123
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:123
|
2020-09-10 23:28:19 +02:00
|
|
|
func writemetricsFindResponseTreeJSON(qq422016 qtio422016.Writer, paths []string, delimiter string, addWildcards bool) {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:123
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:123
|
2020-09-10 23:28:19 +02:00
|
|
|
streammetricsFindResponseTreeJSON(qw422016, paths, delimiter, addWildcards)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:123
|
2020-09-10 23:28:19 +02:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:123
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:123
|
2020-09-10 23:28:19 +02:00
|
|
|
func metricsFindResponseTreeJSON(paths []string, delimiter string, addWildcards bool) string {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:123
|
2020-09-10 23:28:19 +02:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:123
|
2020-09-10 23:28:19 +02:00
|
|
|
writemetricsFindResponseTreeJSON(qb422016, paths, delimiter, addWildcards)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:123
|
2020-09-10 23:28:19 +02:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:123
|
2020-09-10 23:28:19 +02:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:123
|
2020-09-10 23:28:19 +02:00
|
|
|
return qs422016
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:123
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:125
|
2020-09-10 23:28:19 +02:00
|
|
|
func streammetricPathName(qw422016 *qt422016.Writer, path, delimiter string) {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:127
|
2020-09-10 23:28:19 +02:00
|
|
|
name := path
|
|
|
|
for strings.HasSuffix(name, delimiter) {
|
|
|
|
name = name[:len(name)-1]
|
|
|
|
}
|
|
|
|
if n := strings.LastIndexByte(name, delimiter[0]); n >= 0 {
|
|
|
|
name = name[n+1:]
|
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:135
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016.N().Q(name)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:136
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:136
|
2020-09-10 23:28:19 +02:00
|
|
|
func writemetricPathName(qq422016 qtio422016.Writer, path, delimiter string) {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:136
|
2020-09-10 23:28:19 +02:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:136
|
2020-09-10 23:28:19 +02:00
|
|
|
streammetricPathName(qw422016, path, delimiter)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:136
|
2020-09-10 23:28:19 +02:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:136
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|
|
|
|
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:136
|
2020-09-10 23:28:19 +02:00
|
|
|
func metricPathName(path, delimiter string) string {
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:136
|
2020-09-10 23:28:19 +02:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:136
|
2020-09-10 23:28:19 +02:00
|
|
|
writemetricPathName(qb422016, path, delimiter)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:136
|
2020-09-10 23:28:19 +02:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:136
|
2020-09-10 23:28:19 +02:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:136
|
2020-09-10 23:28:19 +02:00
|
|
|
return qs422016
|
2020-09-29 17:00:28 +02:00
|
|
|
//line app/vmselect/graphite/metrics_find_response.qtpl:136
|
2020-09-10 23:28:19 +02:00
|
|
|
}
|