VictoriaMetrics/app/vmselect/prometheus/export.qtpl.go

599 lines
21 KiB
Go
Raw Normal View History

2019-05-22 23:16:55 +02: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 (
"bytes"
"math"
"strings"
"time"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/querytracer"
2019-05-22 23:16:55 +02:00
"github.com/VictoriaMetrics/VictoriaMetrics/lib/storage"
"github.com/valyala/quicktemplate"
)
//line app/vmselect/prometheus/export.qtpl:14
2019-05-22 23:16:55 +02:00
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line app/vmselect/prometheus/export.qtpl:14
2019-05-22 23:16:55 +02:00
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line app/vmselect/prometheus/export.qtpl:14
func StreamExportCSVLine(qw422016 *qt422016.Writer, xb *exportBlock, fieldNames []string) {
//line app/vmselect/prometheus/export.qtpl:15
if len(xb.timestamps) == 0 || len(fieldNames) == 0 {
//line app/vmselect/prometheus/export.qtpl:15
return
//line app/vmselect/prometheus/export.qtpl:15
}
//line app/vmselect/prometheus/export.qtpl:16
for i, timestamp := range xb.timestamps {
//line app/vmselect/prometheus/export.qtpl:17
value := xb.values[i]
//line app/vmselect/prometheus/export.qtpl:18
streamexportCSVField(qw422016, xb.mn, fieldNames[0], timestamp, value)
//line app/vmselect/prometheus/export.qtpl:19
for _, fieldName := range fieldNames[1:] {
//line app/vmselect/prometheus/export.qtpl:19
qw422016.N().S(`,`)
//line app/vmselect/prometheus/export.qtpl:21
streamexportCSVField(qw422016, xb.mn, fieldName, timestamp, value)
//line app/vmselect/prometheus/export.qtpl:22
}
//line app/vmselect/prometheus/export.qtpl:23
qw422016.N().S(`
`)
//line app/vmselect/prometheus/export.qtpl:24
}
//line app/vmselect/prometheus/export.qtpl:25
}
//line app/vmselect/prometheus/export.qtpl:25
func WriteExportCSVLine(qq422016 qtio422016.Writer, xb *exportBlock, fieldNames []string) {
//line app/vmselect/prometheus/export.qtpl:25
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:25
StreamExportCSVLine(qw422016, xb, fieldNames)
//line app/vmselect/prometheus/export.qtpl:25
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:25
}
//line app/vmselect/prometheus/export.qtpl:25
func ExportCSVLine(xb *exportBlock, fieldNames []string) string {
//line app/vmselect/prometheus/export.qtpl:25
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:25
WriteExportCSVLine(qb422016, xb, fieldNames)
//line app/vmselect/prometheus/export.qtpl:25
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:25
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:25
return qs422016
//line app/vmselect/prometheus/export.qtpl:25
}
//line app/vmselect/prometheus/export.qtpl:27
func streamexportCSVField(qw422016 *qt422016.Writer, mn *storage.MetricName, fieldName string, timestamp int64, value float64) {
//line app/vmselect/prometheus/export.qtpl:28
if fieldName == "__value__" {
//line app/vmselect/prometheus/export.qtpl:29
qw422016.N().F(value)
//line app/vmselect/prometheus/export.qtpl:30
return
//line app/vmselect/prometheus/export.qtpl:31
}
//line app/vmselect/prometheus/export.qtpl:32
if fieldName == "__timestamp__" {
//line app/vmselect/prometheus/export.qtpl:33
qw422016.N().DL(timestamp)
//line app/vmselect/prometheus/export.qtpl:34
return
//line app/vmselect/prometheus/export.qtpl:35
}
//line app/vmselect/prometheus/export.qtpl:36
if strings.HasPrefix(fieldName, "__timestamp__:") {
//line app/vmselect/prometheus/export.qtpl:37
timeFormat := fieldName[len("__timestamp__:"):]
//line app/vmselect/prometheus/export.qtpl:38
switch timeFormat {
//line app/vmselect/prometheus/export.qtpl:39
case "unix_s":
//line app/vmselect/prometheus/export.qtpl:40
qw422016.N().DL(timestamp / 1000)
//line app/vmselect/prometheus/export.qtpl:41
case "unix_ms":
//line app/vmselect/prometheus/export.qtpl:42
qw422016.N().DL(timestamp)
//line app/vmselect/prometheus/export.qtpl:43
case "unix_ns":
//line app/vmselect/prometheus/export.qtpl:44
qw422016.N().DL(timestamp * 1e6)
//line app/vmselect/prometheus/export.qtpl:45
case "rfc3339":
//line app/vmselect/prometheus/export.qtpl:47
bb := quicktemplate.AcquireByteBuffer()
bb.B = time.Unix(timestamp/1000, (timestamp%1000)*1e6).AppendFormat(bb.B[:0], time.RFC3339)
//line app/vmselect/prometheus/export.qtpl:50
qw422016.N().Z(bb.B)
//line app/vmselect/prometheus/export.qtpl:52
quicktemplate.ReleaseByteBuffer(bb)
//line app/vmselect/prometheus/export.qtpl:54
default:
//line app/vmselect/prometheus/export.qtpl:55
if strings.HasPrefix(timeFormat, "custom:") {
//line app/vmselect/prometheus/export.qtpl:57
layout := timeFormat[len("custom:"):]
bb := quicktemplate.AcquireByteBuffer()
bb.B = time.Unix(timestamp/1000, (timestamp%1000)*1e6).AppendFormat(bb.B[:0], layout)
//line app/vmselect/prometheus/export.qtpl:61
if bytes.ContainsAny(bb.B, `"`+",\n") {
//line app/vmselect/prometheus/export.qtpl:62
qw422016.E().QZ(bb.B)
//line app/vmselect/prometheus/export.qtpl:63
} else {
//line app/vmselect/prometheus/export.qtpl:64
qw422016.N().Z(bb.B)
//line app/vmselect/prometheus/export.qtpl:65
}
//line app/vmselect/prometheus/export.qtpl:67
quicktemplate.ReleaseByteBuffer(bb)
//line app/vmselect/prometheus/export.qtpl:69
} else {
//line app/vmselect/prometheus/export.qtpl:69
qw422016.N().S(`Unsupported timeFormat=`)
//line app/vmselect/prometheus/export.qtpl:70
qw422016.N().S(timeFormat)
//line app/vmselect/prometheus/export.qtpl:71
}
//line app/vmselect/prometheus/export.qtpl:72
}
//line app/vmselect/prometheus/export.qtpl:73
return
//line app/vmselect/prometheus/export.qtpl:74
}
//line app/vmselect/prometheus/export.qtpl:75
v := mn.GetTagValue(fieldName)
//line app/vmselect/prometheus/export.qtpl:76
if bytes.ContainsAny(v, `"`+",\n") {
//line app/vmselect/prometheus/export.qtpl:77
qw422016.N().QZ(v)
//line app/vmselect/prometheus/export.qtpl:78
} else {
//line app/vmselect/prometheus/export.qtpl:79
qw422016.N().Z(v)
//line app/vmselect/prometheus/export.qtpl:80
}
//line app/vmselect/prometheus/export.qtpl:81
}
//line app/vmselect/prometheus/export.qtpl:81
func writeexportCSVField(qq422016 qtio422016.Writer, mn *storage.MetricName, fieldName string, timestamp int64, value float64) {
//line app/vmselect/prometheus/export.qtpl:81
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:81
streamexportCSVField(qw422016, mn, fieldName, timestamp, value)
//line app/vmselect/prometheus/export.qtpl:81
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:81
}
//line app/vmselect/prometheus/export.qtpl:81
func exportCSVField(mn *storage.MetricName, fieldName string, timestamp int64, value float64) string {
//line app/vmselect/prometheus/export.qtpl:81
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:81
writeexportCSVField(qb422016, mn, fieldName, timestamp, value)
//line app/vmselect/prometheus/export.qtpl:81
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:81
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:81
return qs422016
//line app/vmselect/prometheus/export.qtpl:81
}
//line app/vmselect/prometheus/export.qtpl:83
func StreamExportPrometheusLine(qw422016 *qt422016.Writer, xb *exportBlock) {
//line app/vmselect/prometheus/export.qtpl:84
if len(xb.timestamps) == 0 {
//line app/vmselect/prometheus/export.qtpl:84
2019-05-22 23:16:55 +02:00
return
//line app/vmselect/prometheus/export.qtpl:84
}
//line app/vmselect/prometheus/export.qtpl:85
2019-05-22 23:16:55 +02:00
bb := quicktemplate.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:86
writeprometheusMetricName(bb, xb.mn)
2019-05-22 23:16:55 +02:00
//line app/vmselect/prometheus/export.qtpl:87
for i, ts := range xb.timestamps {
//line app/vmselect/prometheus/export.qtpl:88
qw422016.N().Z(bb.B)
//line app/vmselect/prometheus/export.qtpl:88
qw422016.N().S(` `)
//line app/vmselect/prometheus/export.qtpl:89
qw422016.N().F(xb.values[i])
//line app/vmselect/prometheus/export.qtpl:89
qw422016.N().S(` `)
//line app/vmselect/prometheus/export.qtpl:90
qw422016.N().DL(ts)
//line app/vmselect/prometheus/export.qtpl:90
2019-05-22 23:16:55 +02:00
qw422016.N().S(`
`)
//line app/vmselect/prometheus/export.qtpl:91
}
//line app/vmselect/prometheus/export.qtpl:92
2019-05-22 23:16:55 +02:00
quicktemplate.ReleaseByteBuffer(bb)
//line app/vmselect/prometheus/export.qtpl:93
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:93
func WriteExportPrometheusLine(qq422016 qtio422016.Writer, xb *exportBlock) {
//line app/vmselect/prometheus/export.qtpl:93
2019-05-22 23:16:55 +02:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:93
StreamExportPrometheusLine(qw422016, xb)
//line app/vmselect/prometheus/export.qtpl:93
2019-05-22 23:16:55 +02:00
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:93
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:93
func ExportPrometheusLine(xb *exportBlock) string {
//line app/vmselect/prometheus/export.qtpl:93
2019-05-22 23:16:55 +02:00
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:93
WriteExportPrometheusLine(qb422016, xb)
//line app/vmselect/prometheus/export.qtpl:93
2019-05-22 23:16:55 +02:00
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:93
2019-05-22 23:16:55 +02:00
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:93
2019-05-22 23:16:55 +02:00
return qs422016
//line app/vmselect/prometheus/export.qtpl:93
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:95
func StreamExportJSONLine(qw422016 *qt422016.Writer, xb *exportBlock) {
//line app/vmselect/prometheus/export.qtpl:96
if len(xb.timestamps) == 0 {
//line app/vmselect/prometheus/export.qtpl:96
2019-05-22 23:16:55 +02:00
return
//line app/vmselect/prometheus/export.qtpl:96
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:96
2019-05-22 23:16:55 +02:00
qw422016.N().S(`{"metric":`)
//line app/vmselect/prometheus/export.qtpl:98
streammetricNameObject(qw422016, xb.mn)
//line app/vmselect/prometheus/export.qtpl:98
2019-05-22 23:16:55 +02:00
qw422016.N().S(`,"values":[`)
//line app/vmselect/prometheus/export.qtpl:100
if len(xb.values) > 0 {
//line app/vmselect/prometheus/export.qtpl:101
values := xb.values
2019-05-22 23:16:55 +02:00
//line app/vmselect/prometheus/export.qtpl:102
qw422016.N().F(values[0])
//line app/vmselect/prometheus/export.qtpl:103
2019-05-22 23:16:55 +02:00
values = values[1:]
//line app/vmselect/prometheus/export.qtpl:104
2019-05-22 23:16:55 +02:00
for _, v := range values {
//line app/vmselect/prometheus/export.qtpl:104
qw422016.N().S(`,`)
//line app/vmselect/prometheus/export.qtpl:105
if math.IsNaN(v) {
//line app/vmselect/prometheus/export.qtpl:105
qw422016.N().S(`null`)
//line app/vmselect/prometheus/export.qtpl:105
} else {
//line app/vmselect/prometheus/export.qtpl:105
qw422016.N().F(v)
//line app/vmselect/prometheus/export.qtpl:105
}
//line app/vmselect/prometheus/export.qtpl:106
}
//line app/vmselect/prometheus/export.qtpl:107
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:107
2019-05-22 23:16:55 +02:00
qw422016.N().S(`],"timestamps":[`)
//line app/vmselect/prometheus/export.qtpl:110
if len(xb.timestamps) > 0 {
//line app/vmselect/prometheus/export.qtpl:111
timestamps := xb.timestamps
2019-05-22 23:16:55 +02:00
//line app/vmselect/prometheus/export.qtpl:112
qw422016.N().DL(timestamps[0])
//line app/vmselect/prometheus/export.qtpl:113
2019-05-22 23:16:55 +02:00
timestamps = timestamps[1:]
//line app/vmselect/prometheus/export.qtpl:114
2019-05-22 23:16:55 +02:00
for _, ts := range timestamps {
//line app/vmselect/prometheus/export.qtpl:114
qw422016.N().S(`,`)
//line app/vmselect/prometheus/export.qtpl:115
qw422016.N().DL(ts)
//line app/vmselect/prometheus/export.qtpl:116
}
//line app/vmselect/prometheus/export.qtpl:117
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:117
2019-05-22 23:16:55 +02:00
qw422016.N().S(`]}`)
//line app/vmselect/prometheus/export.qtpl:119
2019-05-22 23:16:55 +02:00
qw422016.N().S(`
`)
//line app/vmselect/prometheus/export.qtpl:120
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:120
func WriteExportJSONLine(qq422016 qtio422016.Writer, xb *exportBlock) {
//line app/vmselect/prometheus/export.qtpl:120
2019-05-22 23:16:55 +02:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:120
StreamExportJSONLine(qw422016, xb)
//line app/vmselect/prometheus/export.qtpl:120
2019-05-22 23:16:55 +02:00
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:120
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:120
func ExportJSONLine(xb *exportBlock) string {
//line app/vmselect/prometheus/export.qtpl:120
2019-05-22 23:16:55 +02:00
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:120
WriteExportJSONLine(qb422016, xb)
//line app/vmselect/prometheus/export.qtpl:120
2019-05-22 23:16:55 +02:00
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:120
2019-05-22 23:16:55 +02:00
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:120
2019-05-22 23:16:55 +02:00
return qs422016
//line app/vmselect/prometheus/export.qtpl:120
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:122
func StreamExportPromAPILine(qw422016 *qt422016.Writer, xb *exportBlock) {
//line app/vmselect/prometheus/export.qtpl:122
2019-05-22 23:16:55 +02:00
qw422016.N().S(`{"metric":`)
//line app/vmselect/prometheus/export.qtpl:124
streammetricNameObject(qw422016, xb.mn)
//line app/vmselect/prometheus/export.qtpl:124
qw422016.N().S(`,"values":`)
//line app/vmselect/prometheus/export.qtpl:125
streamvaluesWithTimestamps(qw422016, xb.values, xb.timestamps)
//line app/vmselect/prometheus/export.qtpl:125
2019-05-22 23:16:55 +02:00
qw422016.N().S(`}`)
//line app/vmselect/prometheus/export.qtpl:127
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:127
func WriteExportPromAPILine(qq422016 qtio422016.Writer, xb *exportBlock) {
//line app/vmselect/prometheus/export.qtpl:127
2019-05-22 23:16:55 +02:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:127
StreamExportPromAPILine(qw422016, xb)
//line app/vmselect/prometheus/export.qtpl:127
2019-05-22 23:16:55 +02:00
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:127
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:127
func ExportPromAPILine(xb *exportBlock) string {
//line app/vmselect/prometheus/export.qtpl:127
2019-05-22 23:16:55 +02:00
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:127
WriteExportPromAPILine(qb422016, xb)
//line app/vmselect/prometheus/export.qtpl:127
2019-05-22 23:16:55 +02:00
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:127
2019-05-22 23:16:55 +02:00
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:127
2019-05-22 23:16:55 +02:00
return qs422016
//line app/vmselect/prometheus/export.qtpl:127
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:129
func StreamExportPromAPIResponse(qw422016 *qt422016.Writer, resultsCh <-chan *quicktemplate.ByteBuffer, qt *querytracer.Tracer) {
//line app/vmselect/prometheus/export.qtpl:129
qw422016.N().S(`{`)
//line app/vmselect/prometheus/export.qtpl:132
lines := 0
bytesTotal := 0
//line app/vmselect/prometheus/export.qtpl:134
qw422016.N().S(`"status":"success","data":{"resultType":"matrix","result":[`)
//line app/vmselect/prometheus/export.qtpl:139
2019-05-22 23:16:55 +02:00
bb, ok := <-resultsCh
//line app/vmselect/prometheus/export.qtpl:140
if ok {
//line app/vmselect/prometheus/export.qtpl:141
qw422016.N().Z(bb.B)
//line app/vmselect/prometheus/export.qtpl:143
lines++
bytesTotal += len(bb.B)
2019-05-22 23:16:55 +02:00
quicktemplate.ReleaseByteBuffer(bb)
//line app/vmselect/prometheus/export.qtpl:147
2019-05-22 23:16:55 +02:00
for bb := range resultsCh {
//line app/vmselect/prometheus/export.qtpl:147
qw422016.N().S(`,`)
//line app/vmselect/prometheus/export.qtpl:148
qw422016.N().Z(bb.B)
//line app/vmselect/prometheus/export.qtpl:150
lines++
bytesTotal += len(bb.B)
2019-05-22 23:16:55 +02:00
quicktemplate.ReleaseByteBuffer(bb)
//line app/vmselect/prometheus/export.qtpl:154
}
//line app/vmselect/prometheus/export.qtpl:155
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:155
qw422016.N().S(`]}`)
//line app/vmselect/prometheus/export.qtpl:159
qt.Donef("export format=promapi: lines=%d, bytes=%d", lines, bytesTotal)
//line app/vmselect/prometheus/export.qtpl:161
streamdumpQueryTrace(qw422016, qt)
//line app/vmselect/prometheus/export.qtpl:161
qw422016.N().S(`}`)
//line app/vmselect/prometheus/export.qtpl:163
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:163
func WriteExportPromAPIResponse(qq422016 qtio422016.Writer, resultsCh <-chan *quicktemplate.ByteBuffer, qt *querytracer.Tracer) {
//line app/vmselect/prometheus/export.qtpl:163
2019-05-22 23:16:55 +02:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:163
StreamExportPromAPIResponse(qw422016, resultsCh, qt)
//line app/vmselect/prometheus/export.qtpl:163
2019-05-22 23:16:55 +02:00
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:163
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:163
func ExportPromAPIResponse(resultsCh <-chan *quicktemplate.ByteBuffer, qt *querytracer.Tracer) string {
//line app/vmselect/prometheus/export.qtpl:163
2019-05-22 23:16:55 +02:00
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:163
WriteExportPromAPIResponse(qb422016, resultsCh, qt)
//line app/vmselect/prometheus/export.qtpl:163
2019-05-22 23:16:55 +02:00
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:163
2019-05-22 23:16:55 +02:00
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:163
2019-05-22 23:16:55 +02:00
return qs422016
//line app/vmselect/prometheus/export.qtpl:163
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:165
func StreamExportStdResponse(qw422016 *qt422016.Writer, resultsCh <-chan *quicktemplate.ByteBuffer, qt *querytracer.Tracer) {
//line app/vmselect/prometheus/export.qtpl:166
for bb := range resultsCh {
//line app/vmselect/prometheus/export.qtpl:167
qw422016.N().Z(bb.B)
//line app/vmselect/prometheus/export.qtpl:168
2019-05-22 23:16:55 +02:00
quicktemplate.ReleaseByteBuffer(bb)
//line app/vmselect/prometheus/export.qtpl:169
}
//line app/vmselect/prometheus/export.qtpl:170
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:170
func WriteExportStdResponse(qq422016 qtio422016.Writer, resultsCh <-chan *quicktemplate.ByteBuffer, qt *querytracer.Tracer) {
//line app/vmselect/prometheus/export.qtpl:170
2019-05-22 23:16:55 +02:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:170
StreamExportStdResponse(qw422016, resultsCh, qt)
//line app/vmselect/prometheus/export.qtpl:170
2019-05-22 23:16:55 +02:00
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:170
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:170
func ExportStdResponse(resultsCh <-chan *quicktemplate.ByteBuffer, qt *querytracer.Tracer) string {
//line app/vmselect/prometheus/export.qtpl:170
2019-05-22 23:16:55 +02:00
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:170
WriteExportStdResponse(qb422016, resultsCh, qt)
//line app/vmselect/prometheus/export.qtpl:170
2019-05-22 23:16:55 +02:00
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:170
2019-05-22 23:16:55 +02:00
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:170
2019-05-22 23:16:55 +02:00
return qs422016
//line app/vmselect/prometheus/export.qtpl:170
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:172
func streamprometheusMetricName(qw422016 *qt422016.Writer, mn *storage.MetricName) {
//line app/vmselect/prometheus/export.qtpl:173
qw422016.N().Z(mn.MetricGroup)
//line app/vmselect/prometheus/export.qtpl:174
2019-05-22 23:16:55 +02:00
if len(mn.Tags) > 0 {
//line app/vmselect/prometheus/export.qtpl:174
2019-05-22 23:16:55 +02:00
qw422016.N().S(`{`)
//line app/vmselect/prometheus/export.qtpl:176
2019-05-22 23:16:55 +02:00
tags := mn.Tags
//line app/vmselect/prometheus/export.qtpl:177
2019-05-22 23:16:55 +02:00
qw422016.N().Z(tags[0].Key)
//line app/vmselect/prometheus/export.qtpl:177
2019-05-22 23:16:55 +02:00
qw422016.N().S(`=`)
//line app/vmselect/prometheus/export.qtpl:177
qw422016.N().QZ(tags[0].Value)
//line app/vmselect/prometheus/export.qtpl:178
2019-05-22 23:16:55 +02:00
tags = tags[1:]
//line app/vmselect/prometheus/export.qtpl:179
for i := range tags {
//line app/vmselect/prometheus/export.qtpl:180
2019-05-22 23:16:55 +02:00
tag := &tags[i]
//line app/vmselect/prometheus/export.qtpl:180
qw422016.N().S(`,`)
//line app/vmselect/prometheus/export.qtpl:181
2019-05-22 23:16:55 +02:00
qw422016.N().Z(tag.Key)
//line app/vmselect/prometheus/export.qtpl:181
2019-05-22 23:16:55 +02:00
qw422016.N().S(`=`)
//line app/vmselect/prometheus/export.qtpl:181
qw422016.N().QZ(tag.Value)
//line app/vmselect/prometheus/export.qtpl:182
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:182
2019-05-22 23:16:55 +02:00
qw422016.N().S(`}`)
//line app/vmselect/prometheus/export.qtpl:184
}
//line app/vmselect/prometheus/export.qtpl:185
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:185
2019-05-22 23:16:55 +02:00
func writeprometheusMetricName(qq422016 qtio422016.Writer, mn *storage.MetricName) {
//line app/vmselect/prometheus/export.qtpl:185
2019-05-22 23:16:55 +02:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:185
2019-05-22 23:16:55 +02:00
streamprometheusMetricName(qw422016, mn)
//line app/vmselect/prometheus/export.qtpl:185
2019-05-22 23:16:55 +02:00
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:185
2019-05-22 23:16:55 +02:00
}
//line app/vmselect/prometheus/export.qtpl:185
2019-05-22 23:16:55 +02:00
func prometheusMetricName(mn *storage.MetricName) string {
//line app/vmselect/prometheus/export.qtpl:185
2019-05-22 23:16:55 +02:00
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:185
2019-05-22 23:16:55 +02:00
writeprometheusMetricName(qb422016, mn)
//line app/vmselect/prometheus/export.qtpl:185
2019-05-22 23:16:55 +02:00
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:185
2019-05-22 23:16:55 +02:00
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:185
2019-05-22 23:16:55 +02:00
return qs422016
//line app/vmselect/prometheus/export.qtpl:185
2019-05-22 23:16:55 +02:00
}