2019-05-22 21:16:55 +00:00
|
|
|
// Code generated by qtc from "export.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:1
|
|
|
|
package prometheus
|
|
|
|
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:1
|
|
|
|
import (
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/storage"
|
|
|
|
"github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:8
|
2019-05-22 21:16:55 +00:00
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:8
|
2019-05-22 21:16:55 +00:00
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:8
|
|
|
|
func StreamExportPrometheusLine(qw422016 *qt422016.Writer, xb *exportBlock) {
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:9
|
|
|
|
if len(xb.timestamps) == 0 {
|
2019-05-22 21:16:55 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:9
|
|
|
|
return
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:9
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:10
|
2019-05-22 21:16:55 +00:00
|
|
|
bb := quicktemplate.AcquireByteBuffer()
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:11
|
|
|
|
writeprometheusMetricName(bb, xb.mn)
|
2019-05-22 21:16:55 +00:00
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:12
|
|
|
|
for i, ts := range xb.timestamps {
|
2019-05-22 21:16:55 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:13
|
|
|
|
qw422016.N().Z(bb.B)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:13
|
|
|
|
qw422016.N().S(` `)
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:14
|
|
|
|
qw422016.N().F(xb.values[i])
|
2019-05-22 21:16:55 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:14
|
|
|
|
qw422016.N().S(` `)
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:15
|
2019-10-17 15:22:56 +00:00
|
|
|
qw422016.N().DL(ts)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:15
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:16
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:17
|
2019-05-22 21:16:55 +00:00
|
|
|
quicktemplate.ReleaseByteBuffer(bb)
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:18
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:18
|
|
|
|
func WriteExportPrometheusLine(qq422016 qtio422016.Writer, xb *exportBlock) {
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:18
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:18
|
|
|
|
StreamExportPrometheusLine(qw422016, xb)
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:18
|
2019-05-22 21:16:55 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:18
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:18
|
|
|
|
func ExportPrometheusLine(xb *exportBlock) string {
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:18
|
2019-05-22 21:16:55 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:18
|
|
|
|
WriteExportPrometheusLine(qb422016, xb)
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:18
|
2019-05-22 21:16:55 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:18
|
2019-05-22 21:16:55 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:18
|
2019-05-22 21:16:55 +00:00
|
|
|
return qs422016
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:18
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:20
|
|
|
|
func StreamExportJSONLine(qw422016 *qt422016.Writer, xb *exportBlock) {
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:21
|
|
|
|
if len(xb.timestamps) == 0 {
|
2019-05-22 21:16:55 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:21
|
|
|
|
return
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:21
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:21
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`{"metric":`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:23
|
|
|
|
streammetricNameObject(qw422016, xb.mn)
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:23
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`,"values":[`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:25
|
|
|
|
if len(xb.values) > 0 {
|
2019-05-22 21:16:55 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:26
|
2020-09-26 01:29:45 +00:00
|
|
|
values := xb.values
|
2019-05-22 21:16:55 +00:00
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:27
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().F(values[0])
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:28
|
2019-05-22 21:16:55 +00:00
|
|
|
values = values[1:]
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:29
|
2019-05-22 21:16:55 +00:00
|
|
|
for _, v := range values {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:29
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`,`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:30
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().F(v)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:31
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:32
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:32
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`],"timestamps":[`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:35
|
|
|
|
if len(xb.timestamps) > 0 {
|
2019-05-22 21:16:55 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:36
|
2020-09-26 01:29:45 +00:00
|
|
|
timestamps := xb.timestamps
|
2019-05-22 21:16:55 +00:00
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:37
|
2019-10-17 15:22:56 +00:00
|
|
|
qw422016.N().DL(timestamps[0])
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:38
|
2019-05-22 21:16:55 +00:00
|
|
|
timestamps = timestamps[1:]
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:39
|
2019-05-22 21:16:55 +00:00
|
|
|
for _, ts := range timestamps {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:39
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`,`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:40
|
2019-10-17 15:22:56 +00:00
|
|
|
qw422016.N().DL(ts)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:41
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:42
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:42
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`]}`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:44
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:45
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:45
|
|
|
|
func WriteExportJSONLine(qq422016 qtio422016.Writer, xb *exportBlock) {
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:45
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:45
|
|
|
|
StreamExportJSONLine(qw422016, xb)
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:45
|
2019-05-22 21:16:55 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:45
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:45
|
|
|
|
func ExportJSONLine(xb *exportBlock) string {
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:45
|
2019-05-22 21:16:55 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:45
|
|
|
|
WriteExportJSONLine(qb422016, xb)
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:45
|
2019-05-22 21:16:55 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:45
|
2019-05-22 21:16:55 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:45
|
2019-05-22 21:16:55 +00:00
|
|
|
return qs422016
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:45
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:47
|
|
|
|
func StreamExportPromAPILine(qw422016 *qt422016.Writer, xb *exportBlock) {
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:47
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`{"metric":`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:49
|
|
|
|
streammetricNameObject(qw422016, xb.mn)
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:49
|
|
|
|
qw422016.N().S(`,"values":`)
|
2019-05-22 21:16:55 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:50
|
2020-09-26 01:29:45 +00:00
|
|
|
streamvaluesWithTimestamps(qw422016, xb.values, xb.timestamps)
|
2019-05-22 21:16:55 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:50
|
|
|
|
qw422016.N().S(`}`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:52
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:52
|
|
|
|
func WriteExportPromAPILine(qq422016 qtio422016.Writer, xb *exportBlock) {
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:52
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:52
|
|
|
|
StreamExportPromAPILine(qw422016, xb)
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:52
|
2019-05-22 21:16:55 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:52
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:52
|
|
|
|
func ExportPromAPILine(xb *exportBlock) string {
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:52
|
2019-05-22 21:16:55 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:52
|
|
|
|
WriteExportPromAPILine(qb422016, xb)
|
|
|
|
//line app/vmselect/prometheus/export.qtpl:52
|
2019-05-22 21:16:55 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:52
|
2019-05-22 21:16:55 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:52
|
2019-05-22 21:16:55 +00:00
|
|
|
return qs422016
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:52
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:54
|
2019-05-22 21:16:55 +00:00
|
|
|
func StreamExportPromAPIResponse(qw422016 *qt422016.Writer, resultsCh <-chan *quicktemplate.ByteBuffer) {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:54
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`{"status":"success","data":{"resultType":"matrix","result":[`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:60
|
2019-05-22 21:16:55 +00:00
|
|
|
bb, ok := <-resultsCh
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:61
|
2019-05-22 21:16:55 +00:00
|
|
|
if ok {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:62
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().Z(bb.B)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:63
|
2019-05-22 21:16:55 +00:00
|
|
|
quicktemplate.ReleaseByteBuffer(bb)
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:64
|
2019-05-22 21:16:55 +00:00
|
|
|
for bb := range resultsCh {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:64
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`,`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:65
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().Z(bb.B)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:66
|
2019-05-22 21:16:55 +00:00
|
|
|
quicktemplate.ReleaseByteBuffer(bb)
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:67
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:68
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:68
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`]}}`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:72
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:72
|
2019-05-22 21:16:55 +00:00
|
|
|
func WriteExportPromAPIResponse(qq422016 qtio422016.Writer, resultsCh <-chan *quicktemplate.ByteBuffer) {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:72
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:72
|
2019-05-22 21:16:55 +00:00
|
|
|
StreamExportPromAPIResponse(qw422016, resultsCh)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:72
|
2019-05-22 21:16:55 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:72
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:72
|
2019-05-22 21:16:55 +00:00
|
|
|
func ExportPromAPIResponse(resultsCh <-chan *quicktemplate.ByteBuffer) string {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:72
|
2019-05-22 21:16:55 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:72
|
2019-05-22 21:16:55 +00:00
|
|
|
WriteExportPromAPIResponse(qb422016, resultsCh)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:72
|
2019-05-22 21:16:55 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:72
|
2019-05-22 21:16:55 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:72
|
2019-05-22 21:16:55 +00:00
|
|
|
return qs422016
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:72
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:74
|
2019-05-22 21:16:55 +00:00
|
|
|
func StreamExportStdResponse(qw422016 *qt422016.Writer, resultsCh <-chan *quicktemplate.ByteBuffer) {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:75
|
2019-05-22 21:16:55 +00:00
|
|
|
for bb := range resultsCh {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:76
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().Z(bb.B)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:77
|
2019-05-22 21:16:55 +00:00
|
|
|
quicktemplate.ReleaseByteBuffer(bb)
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:78
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:79
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:79
|
2019-05-22 21:16:55 +00:00
|
|
|
func WriteExportStdResponse(qq422016 qtio422016.Writer, resultsCh <-chan *quicktemplate.ByteBuffer) {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:79
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:79
|
2019-05-22 21:16:55 +00:00
|
|
|
StreamExportStdResponse(qw422016, resultsCh)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:79
|
2019-05-22 21:16:55 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:79
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:79
|
2019-05-22 21:16:55 +00:00
|
|
|
func ExportStdResponse(resultsCh <-chan *quicktemplate.ByteBuffer) string {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:79
|
2019-05-22 21:16:55 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:79
|
2019-05-22 21:16:55 +00:00
|
|
|
WriteExportStdResponse(qb422016, resultsCh)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:79
|
2019-05-22 21:16:55 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:79
|
2019-05-22 21:16:55 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:79
|
2019-05-22 21:16:55 +00:00
|
|
|
return qs422016
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:79
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:81
|
2019-05-22 21:16:55 +00:00
|
|
|
func streamprometheusMetricName(qw422016 *qt422016.Writer, mn *storage.MetricName) {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:82
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().Z(mn.MetricGroup)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:83
|
2019-05-22 21:16:55 +00:00
|
|
|
if len(mn.Tags) > 0 {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:83
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`{`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:85
|
2019-05-22 21:16:55 +00:00
|
|
|
tags := mn.Tags
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:86
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().Z(tags[0].Key)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:86
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`=`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:86
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().QZ(tags[0].Value)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:87
|
2019-05-22 21:16:55 +00:00
|
|
|
tags = tags[1:]
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:88
|
2019-05-22 21:16:55 +00:00
|
|
|
for i := range tags {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:89
|
2019-05-22 21:16:55 +00:00
|
|
|
tag := &tags[i]
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:89
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`,`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:90
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().Z(tag.Key)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:90
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`=`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:90
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().QZ(tag.Value)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:91
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:91
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016.N().S(`}`)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:93
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:94
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:94
|
2019-05-22 21:16:55 +00:00
|
|
|
func writeprometheusMetricName(qq422016 qtio422016.Writer, mn *storage.MetricName) {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:94
|
2019-05-22 21:16:55 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:94
|
2019-05-22 21:16:55 +00:00
|
|
|
streamprometheusMetricName(qw422016, mn)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:94
|
2019-05-22 21:16:55 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:94
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|
|
|
|
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:94
|
2019-05-22 21:16:55 +00:00
|
|
|
func prometheusMetricName(mn *storage.MetricName) string {
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:94
|
2019-05-22 21:16:55 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:94
|
2019-05-22 21:16:55 +00:00
|
|
|
writeprometheusMetricName(qb422016, mn)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:94
|
2019-05-22 21:16:55 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:94
|
2019-05-22 21:16:55 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:94
|
2019-05-22 21:16:55 +00:00
|
|
|
return qs422016
|
2020-09-26 01:29:45 +00:00
|
|
|
//line app/vmselect/prometheus/export.qtpl:94
|
2019-05-22 21:16:55 +00:00
|
|
|
}
|