2019-06-10 15:55:20 +00:00
|
|
|
// Code generated by qtc from "labels_count_response.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:1
|
|
|
|
package prometheus
|
|
|
|
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:1
|
|
|
|
import "github.com/VictoriaMetrics/VictoriaMetrics/lib/storage"
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
// LabelsCountResponse generates response for /api/v1/labels/count .
|
2019-06-10 15:55:20 +00:00
|
|
|
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:5
|
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:5
|
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:5
|
2020-11-14 10:36:21 +00:00
|
|
|
func StreamLabelsCountResponse(qw422016 *qt422016.Writer, isPartial bool, labelEntries []storage.TagEntry) {
|
2019-06-10 15:55:20 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:5
|
2020-11-14 10:36:21 +00:00
|
|
|
qw422016.N().S(`{"status":"success","isPartial":`)
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:8
|
|
|
|
if isPartial {
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:8
|
|
|
|
qw422016.N().S(`true`)
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:8
|
|
|
|
} else {
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:8
|
|
|
|
qw422016.N().S(`false`)
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:8
|
|
|
|
}
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:8
|
|
|
|
qw422016.N().S(`,"data":{`)
|
2019-06-10 15:55:20 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:10
|
2020-11-14 10:36:21 +00:00
|
|
|
for i, e := range labelEntries {
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:11
|
2019-06-10 15:55:20 +00:00
|
|
|
qw422016.N().Q(e.Key)
|
2020-11-14 10:36:21 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:11
|
2019-06-10 15:55:20 +00:00
|
|
|
qw422016.N().S(`:`)
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:11
|
2020-11-14 10:36:21 +00:00
|
|
|
qw422016.N().D(len(e.Values))
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:12
|
2019-06-10 15:55:20 +00:00
|
|
|
if i+1 < len(labelEntries) {
|
2020-11-14 10:36:21 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:12
|
2019-06-10 15:55:20 +00:00
|
|
|
qw422016.N().S(`,`)
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:12
|
2020-11-14 10:36:21 +00:00
|
|
|
}
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:13
|
2019-06-10 15:55:20 +00:00
|
|
|
}
|
2020-11-14 10:36:21 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:13
|
2019-06-10 15:55:20 +00:00
|
|
|
qw422016.N().S(`}}`)
|
2020-11-14 10:36:21 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:16
|
2019-06-10 15:55:20 +00:00
|
|
|
}
|
|
|
|
|
2020-11-14 10:36:21 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:16
|
|
|
|
func WriteLabelsCountResponse(qq422016 qtio422016.Writer, isPartial bool, labelEntries []storage.TagEntry) {
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:16
|
2019-06-10 15:55:20 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-11-14 10:36:21 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:16
|
|
|
|
StreamLabelsCountResponse(qw422016, isPartial, labelEntries)
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:16
|
2019-06-10 15:55:20 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-11-14 10:36:21 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:16
|
2019-06-10 15:55:20 +00:00
|
|
|
}
|
|
|
|
|
2020-11-14 10:36:21 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:16
|
|
|
|
func LabelsCountResponse(isPartial bool, labelEntries []storage.TagEntry) string {
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:16
|
2019-06-10 15:55:20 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-11-14 10:36:21 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:16
|
|
|
|
WriteLabelsCountResponse(qb422016, isPartial, labelEntries)
|
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:16
|
2019-06-10 15:55:20 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-11-14 10:36:21 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:16
|
2019-06-10 15:55:20 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-11-14 10:36:21 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:16
|
2019-06-10 15:55:20 +00:00
|
|
|
return qs422016
|
2020-11-14 10:36:21 +00:00
|
|
|
//line app/vmselect/prometheus/labels_count_response.qtpl:16
|
2019-06-10 15:55:20 +00:00
|
|
|
}
|