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

572 lines
20 KiB
Go
Raw Normal View History

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 (
"bytes"
"strings"
"time"
2019-05-22 21:16:55 +00:00
"github.com/VictoriaMetrics/VictoriaMetrics/lib/storage"
"github.com/valyala/quicktemplate"
)
//line app/vmselect/prometheus/export.qtpl:12
2019-05-22 21:16:55 +00:00
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line app/vmselect/prometheus/export.qtpl:12
2019-05-22 21:16:55 +00:00
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line app/vmselect/prometheus/export.qtpl:12
func StreamExportCSVLine(qw422016 *qt422016.Writer, xb *exportBlock, fieldNames []string) {
//line app/vmselect/prometheus/export.qtpl:13
if len(xb.timestamps) == 0 || len(fieldNames) == 0 {
//line app/vmselect/prometheus/export.qtpl:13
return
//line app/vmselect/prometheus/export.qtpl:13
}
//line app/vmselect/prometheus/export.qtpl:14
for i, timestamp := range xb.timestamps {
//line app/vmselect/prometheus/export.qtpl:15
value := xb.values[i]
//line app/vmselect/prometheus/export.qtpl:16
streamexportCSVField(qw422016, xb.mn, fieldNames[0], timestamp, value)
//line app/vmselect/prometheus/export.qtpl:17
for _, fieldName := range fieldNames[1:] {
//line app/vmselect/prometheus/export.qtpl:17
qw422016.N().S(`,`)
//line app/vmselect/prometheus/export.qtpl:19
streamexportCSVField(qw422016, xb.mn, fieldName, timestamp, value)
//line app/vmselect/prometheus/export.qtpl:20
}
//line app/vmselect/prometheus/export.qtpl:21
qw422016.N().S(`
`)
//line app/vmselect/prometheus/export.qtpl:22
}
//line app/vmselect/prometheus/export.qtpl:23
}
//line app/vmselect/prometheus/export.qtpl:23
func WriteExportCSVLine(qq422016 qtio422016.Writer, xb *exportBlock, fieldNames []string) {
//line app/vmselect/prometheus/export.qtpl:23
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:23
StreamExportCSVLine(qw422016, xb, fieldNames)
//line app/vmselect/prometheus/export.qtpl:23
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:23
}
//line app/vmselect/prometheus/export.qtpl:23
func ExportCSVLine(xb *exportBlock, fieldNames []string) string {
//line app/vmselect/prometheus/export.qtpl:23
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:23
WriteExportCSVLine(qb422016, xb, fieldNames)
//line app/vmselect/prometheus/export.qtpl:23
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:23
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:23
return qs422016
//line app/vmselect/prometheus/export.qtpl:23
}
//line app/vmselect/prometheus/export.qtpl:25
func streamexportCSVField(qw422016 *qt422016.Writer, mn *storage.MetricName, fieldName string, timestamp int64, value float64) {
//line app/vmselect/prometheus/export.qtpl:26
if fieldName == "__value__" {
//line app/vmselect/prometheus/export.qtpl:27
qw422016.N().F(value)
//line app/vmselect/prometheus/export.qtpl:28
return
//line app/vmselect/prometheus/export.qtpl:29
}
//line app/vmselect/prometheus/export.qtpl:30
if fieldName == "__timestamp__" {
//line app/vmselect/prometheus/export.qtpl:31
qw422016.N().DL(timestamp)
//line app/vmselect/prometheus/export.qtpl:32
return
//line app/vmselect/prometheus/export.qtpl:33
}
//line app/vmselect/prometheus/export.qtpl:34
if strings.HasPrefix(fieldName, "__timestamp__:") {
//line app/vmselect/prometheus/export.qtpl:35
timeFormat := fieldName[len("__timestamp__:"):]
//line app/vmselect/prometheus/export.qtpl:36
switch timeFormat {
//line app/vmselect/prometheus/export.qtpl:37
case "unix_s":
//line app/vmselect/prometheus/export.qtpl:38
qw422016.N().DL(timestamp / 1000)
//line app/vmselect/prometheus/export.qtpl:39
case "unix_ms":
//line app/vmselect/prometheus/export.qtpl:40
qw422016.N().DL(timestamp)
//line app/vmselect/prometheus/export.qtpl:41
case "unix_ns":
//line app/vmselect/prometheus/export.qtpl:42
qw422016.N().DL(timestamp * 1e6)
//line app/vmselect/prometheus/export.qtpl:43
case "rfc3339":
//line app/vmselect/prometheus/export.qtpl:45
bb := quicktemplate.AcquireByteBuffer()
bb.B = time.Unix(timestamp/1000, (timestamp%1000)*1e6).AppendFormat(bb.B[:0], time.RFC3339)
//line app/vmselect/prometheus/export.qtpl:48
qw422016.N().Z(bb.B)
//line app/vmselect/prometheus/export.qtpl:50
quicktemplate.ReleaseByteBuffer(bb)
//line app/vmselect/prometheus/export.qtpl:52
default:
//line app/vmselect/prometheus/export.qtpl:53
if strings.HasPrefix(timeFormat, "custom:") {
//line app/vmselect/prometheus/export.qtpl:55
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:59
if bytes.ContainsAny(bb.B, `"`+",\n") {
//line app/vmselect/prometheus/export.qtpl:60
qw422016.E().QZ(bb.B)
//line app/vmselect/prometheus/export.qtpl:61
} else {
//line app/vmselect/prometheus/export.qtpl:62
qw422016.N().Z(bb.B)
//line app/vmselect/prometheus/export.qtpl:63
}
//line app/vmselect/prometheus/export.qtpl:65
quicktemplate.ReleaseByteBuffer(bb)
//line app/vmselect/prometheus/export.qtpl:67
} else {
//line app/vmselect/prometheus/export.qtpl:67
qw422016.N().S(`Unsupported timeFormat=`)
//line app/vmselect/prometheus/export.qtpl:68
qw422016.N().S(timeFormat)
//line app/vmselect/prometheus/export.qtpl:69
}
//line app/vmselect/prometheus/export.qtpl:70
}
//line app/vmselect/prometheus/export.qtpl:71
return
//line app/vmselect/prometheus/export.qtpl:72
}
//line app/vmselect/prometheus/export.qtpl:73
v := mn.GetTagValue(fieldName)
//line app/vmselect/prometheus/export.qtpl:74
if bytes.ContainsAny(v, `"`+",\n") {
//line app/vmselect/prometheus/export.qtpl:75
qw422016.N().QZ(v)
//line app/vmselect/prometheus/export.qtpl:76
} else {
//line app/vmselect/prometheus/export.qtpl:77
qw422016.N().Z(v)
//line app/vmselect/prometheus/export.qtpl:78
}
//line app/vmselect/prometheus/export.qtpl:79
}
//line app/vmselect/prometheus/export.qtpl:79
func writeexportCSVField(qq422016 qtio422016.Writer, mn *storage.MetricName, fieldName string, timestamp int64, value float64) {
//line app/vmselect/prometheus/export.qtpl:79
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:79
streamexportCSVField(qw422016, mn, fieldName, timestamp, value)
//line app/vmselect/prometheus/export.qtpl:79
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:79
}
//line app/vmselect/prometheus/export.qtpl:79
func exportCSVField(mn *storage.MetricName, fieldName string, timestamp int64, value float64) string {
//line app/vmselect/prometheus/export.qtpl:79
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:79
writeexportCSVField(qb422016, mn, fieldName, timestamp, value)
//line app/vmselect/prometheus/export.qtpl:79
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:79
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:79
return qs422016
//line app/vmselect/prometheus/export.qtpl:79
}
//line app/vmselect/prometheus/export.qtpl:81
func StreamExportPrometheusLine(qw422016 *qt422016.Writer, xb *exportBlock) {
//line app/vmselect/prometheus/export.qtpl:82
if len(xb.timestamps) == 0 {
//line app/vmselect/prometheus/export.qtpl:82
2019-05-22 21:16:55 +00:00
return
//line app/vmselect/prometheus/export.qtpl:82
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:83
2019-05-22 21:16:55 +00:00
bb := quicktemplate.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:84
writeprometheusMetricName(bb, xb.mn)
2019-05-22 21:16:55 +00:00
//line app/vmselect/prometheus/export.qtpl:85
for i, ts := range xb.timestamps {
//line app/vmselect/prometheus/export.qtpl:86
2019-05-22 21:16:55 +00:00
qw422016.N().Z(bb.B)
//line app/vmselect/prometheus/export.qtpl:86
qw422016.N().S(` `)
//line app/vmselect/prometheus/export.qtpl:87
qw422016.N().F(xb.values[i])
//line app/vmselect/prometheus/export.qtpl:87
2019-05-22 21:16:55 +00:00
qw422016.N().S(` `)
//line app/vmselect/prometheus/export.qtpl:88
qw422016.N().DL(ts)
//line app/vmselect/prometheus/export.qtpl:88
2019-05-22 21:16:55 +00:00
qw422016.N().S(`
`)
//line app/vmselect/prometheus/export.qtpl:89
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:90
2019-05-22 21:16:55 +00:00
quicktemplate.ReleaseByteBuffer(bb)
//line app/vmselect/prometheus/export.qtpl:91
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:91
func WriteExportPrometheusLine(qq422016 qtio422016.Writer, xb *exportBlock) {
//line app/vmselect/prometheus/export.qtpl:91
2019-05-22 21:16:55 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:91
StreamExportPrometheusLine(qw422016, xb)
//line app/vmselect/prometheus/export.qtpl:91
2019-05-22 21:16:55 +00:00
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:91
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:91
func ExportPrometheusLine(xb *exportBlock) string {
//line app/vmselect/prometheus/export.qtpl:91
2019-05-22 21:16:55 +00:00
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:91
WriteExportPrometheusLine(qb422016, xb)
//line app/vmselect/prometheus/export.qtpl:91
2019-05-22 21:16:55 +00:00
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:91
2019-05-22 21:16:55 +00:00
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:91
2019-05-22 21:16:55 +00:00
return qs422016
//line app/vmselect/prometheus/export.qtpl:91
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:93
func StreamExportJSONLine(qw422016 *qt422016.Writer, xb *exportBlock) {
//line app/vmselect/prometheus/export.qtpl:94
if len(xb.timestamps) == 0 {
//line app/vmselect/prometheus/export.qtpl:94
2019-05-22 21:16:55 +00:00
return
//line app/vmselect/prometheus/export.qtpl:94
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:94
2019-05-22 21:16:55 +00:00
qw422016.N().S(`{"metric":`)
//line app/vmselect/prometheus/export.qtpl:96
streammetricNameObject(qw422016, xb.mn)
//line app/vmselect/prometheus/export.qtpl:96
2019-05-22 21:16:55 +00:00
qw422016.N().S(`,"values":[`)
//line app/vmselect/prometheus/export.qtpl:98
if len(xb.values) > 0 {
//line app/vmselect/prometheus/export.qtpl:99
values := xb.values
2019-05-22 21:16:55 +00:00
//line app/vmselect/prometheus/export.qtpl:100
2019-05-22 21:16:55 +00:00
qw422016.N().F(values[0])
//line app/vmselect/prometheus/export.qtpl:101
2019-05-22 21:16:55 +00:00
values = values[1:]
//line app/vmselect/prometheus/export.qtpl:102
2019-05-22 21:16:55 +00:00
for _, v := range values {
//line app/vmselect/prometheus/export.qtpl:102
2019-05-22 21:16:55 +00:00
qw422016.N().S(`,`)
//line app/vmselect/prometheus/export.qtpl:103
2019-05-22 21:16:55 +00:00
qw422016.N().F(v)
//line app/vmselect/prometheus/export.qtpl:104
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:105
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:105
2019-05-22 21:16:55 +00:00
qw422016.N().S(`],"timestamps":[`)
//line app/vmselect/prometheus/export.qtpl:108
if len(xb.timestamps) > 0 {
//line app/vmselect/prometheus/export.qtpl:109
timestamps := xb.timestamps
2019-05-22 21:16:55 +00:00
//line app/vmselect/prometheus/export.qtpl:110
qw422016.N().DL(timestamps[0])
//line app/vmselect/prometheus/export.qtpl:111
2019-05-22 21:16:55 +00:00
timestamps = timestamps[1:]
//line app/vmselect/prometheus/export.qtpl:112
2019-05-22 21:16:55 +00:00
for _, ts := range timestamps {
//line app/vmselect/prometheus/export.qtpl:112
2019-05-22 21:16:55 +00:00
qw422016.N().S(`,`)
//line app/vmselect/prometheus/export.qtpl:113
qw422016.N().DL(ts)
//line app/vmselect/prometheus/export.qtpl:114
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:115
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:115
2019-05-22 21:16:55 +00:00
qw422016.N().S(`]}`)
//line app/vmselect/prometheus/export.qtpl:117
2019-05-22 21:16:55 +00:00
qw422016.N().S(`
`)
//line app/vmselect/prometheus/export.qtpl:118
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:118
func WriteExportJSONLine(qq422016 qtio422016.Writer, xb *exportBlock) {
//line app/vmselect/prometheus/export.qtpl:118
2019-05-22 21:16:55 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:118
StreamExportJSONLine(qw422016, xb)
//line app/vmselect/prometheus/export.qtpl:118
2019-05-22 21:16:55 +00:00
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:118
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:118
func ExportJSONLine(xb *exportBlock) string {
//line app/vmselect/prometheus/export.qtpl:118
2019-05-22 21:16:55 +00:00
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:118
WriteExportJSONLine(qb422016, xb)
//line app/vmselect/prometheus/export.qtpl:118
2019-05-22 21:16:55 +00:00
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:118
2019-05-22 21:16:55 +00:00
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:118
2019-05-22 21:16:55 +00:00
return qs422016
//line app/vmselect/prometheus/export.qtpl:118
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:120
func StreamExportPromAPILine(qw422016 *qt422016.Writer, xb *exportBlock) {
//line app/vmselect/prometheus/export.qtpl:120
2019-05-22 21:16:55 +00:00
qw422016.N().S(`{"metric":`)
//line app/vmselect/prometheus/export.qtpl:122
streammetricNameObject(qw422016, xb.mn)
//line app/vmselect/prometheus/export.qtpl:122
qw422016.N().S(`,"values":`)
//line app/vmselect/prometheus/export.qtpl:123
streamvaluesWithTimestamps(qw422016, xb.values, xb.timestamps)
//line app/vmselect/prometheus/export.qtpl:123
2019-05-22 21:16:55 +00:00
qw422016.N().S(`}`)
//line app/vmselect/prometheus/export.qtpl:125
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:125
func WriteExportPromAPILine(qq422016 qtio422016.Writer, xb *exportBlock) {
//line app/vmselect/prometheus/export.qtpl:125
2019-05-22 21:16:55 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:125
StreamExportPromAPILine(qw422016, xb)
//line app/vmselect/prometheus/export.qtpl:125
2019-05-22 21:16:55 +00:00
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:125
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:125
func ExportPromAPILine(xb *exportBlock) string {
//line app/vmselect/prometheus/export.qtpl:125
2019-05-22 21:16:55 +00:00
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:125
WriteExportPromAPILine(qb422016, xb)
//line app/vmselect/prometheus/export.qtpl:125
2019-05-22 21:16:55 +00:00
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:125
2019-05-22 21:16:55 +00:00
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:125
2019-05-22 21:16:55 +00:00
return qs422016
//line app/vmselect/prometheus/export.qtpl:125
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:127
2019-05-22 21:16:55 +00:00
func StreamExportPromAPIResponse(qw422016 *qt422016.Writer, resultsCh <-chan *quicktemplate.ByteBuffer) {
//line app/vmselect/prometheus/export.qtpl:127
2019-05-22 21:16:55 +00:00
qw422016.N().S(`{"status":"success","data":{"resultType":"matrix","result":[`)
//line app/vmselect/prometheus/export.qtpl:133
2019-05-22 21:16:55 +00:00
bb, ok := <-resultsCh
//line app/vmselect/prometheus/export.qtpl:134
2019-05-22 21:16:55 +00:00
if ok {
//line app/vmselect/prometheus/export.qtpl:135
2019-05-22 21:16:55 +00:00
qw422016.N().Z(bb.B)
//line app/vmselect/prometheus/export.qtpl:136
2019-05-22 21:16:55 +00:00
quicktemplate.ReleaseByteBuffer(bb)
//line app/vmselect/prometheus/export.qtpl:137
2019-05-22 21:16:55 +00:00
for bb := range resultsCh {
//line app/vmselect/prometheus/export.qtpl:137
2019-05-22 21:16:55 +00:00
qw422016.N().S(`,`)
//line app/vmselect/prometheus/export.qtpl:138
2019-05-22 21:16:55 +00:00
qw422016.N().Z(bb.B)
//line app/vmselect/prometheus/export.qtpl:139
2019-05-22 21:16:55 +00:00
quicktemplate.ReleaseByteBuffer(bb)
//line app/vmselect/prometheus/export.qtpl:140
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:141
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:141
2019-05-22 21:16:55 +00:00
qw422016.N().S(`]}}`)
//line app/vmselect/prometheus/export.qtpl:145
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:145
2019-05-22 21:16:55 +00:00
func WriteExportPromAPIResponse(qq422016 qtio422016.Writer, resultsCh <-chan *quicktemplate.ByteBuffer) {
//line app/vmselect/prometheus/export.qtpl:145
2019-05-22 21:16:55 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:145
2019-05-22 21:16:55 +00:00
StreamExportPromAPIResponse(qw422016, resultsCh)
//line app/vmselect/prometheus/export.qtpl:145
2019-05-22 21:16:55 +00:00
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:145
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:145
2019-05-22 21:16:55 +00:00
func ExportPromAPIResponse(resultsCh <-chan *quicktemplate.ByteBuffer) string {
//line app/vmselect/prometheus/export.qtpl:145
2019-05-22 21:16:55 +00:00
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:145
2019-05-22 21:16:55 +00:00
WriteExportPromAPIResponse(qb422016, resultsCh)
//line app/vmselect/prometheus/export.qtpl:145
2019-05-22 21:16:55 +00:00
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:145
2019-05-22 21:16:55 +00:00
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:145
2019-05-22 21:16:55 +00:00
return qs422016
//line app/vmselect/prometheus/export.qtpl:145
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:147
2019-05-22 21:16:55 +00:00
func StreamExportStdResponse(qw422016 *qt422016.Writer, resultsCh <-chan *quicktemplate.ByteBuffer) {
//line app/vmselect/prometheus/export.qtpl:148
2019-05-22 21:16:55 +00:00
for bb := range resultsCh {
//line app/vmselect/prometheus/export.qtpl:149
2019-05-22 21:16:55 +00:00
qw422016.N().Z(bb.B)
//line app/vmselect/prometheus/export.qtpl:150
2019-05-22 21:16:55 +00:00
quicktemplate.ReleaseByteBuffer(bb)
//line app/vmselect/prometheus/export.qtpl:151
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:152
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:152
2019-05-22 21:16:55 +00:00
func WriteExportStdResponse(qq422016 qtio422016.Writer, resultsCh <-chan *quicktemplate.ByteBuffer) {
//line app/vmselect/prometheus/export.qtpl:152
2019-05-22 21:16:55 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:152
2019-05-22 21:16:55 +00:00
StreamExportStdResponse(qw422016, resultsCh)
//line app/vmselect/prometheus/export.qtpl:152
2019-05-22 21:16:55 +00:00
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:152
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:152
2019-05-22 21:16:55 +00:00
func ExportStdResponse(resultsCh <-chan *quicktemplate.ByteBuffer) string {
//line app/vmselect/prometheus/export.qtpl:152
2019-05-22 21:16:55 +00:00
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:152
2019-05-22 21:16:55 +00:00
WriteExportStdResponse(qb422016, resultsCh)
//line app/vmselect/prometheus/export.qtpl:152
2019-05-22 21:16:55 +00:00
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:152
2019-05-22 21:16:55 +00:00
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:152
2019-05-22 21:16:55 +00:00
return qs422016
//line app/vmselect/prometheus/export.qtpl:152
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:154
2019-05-22 21:16:55 +00:00
func streamprometheusMetricName(qw422016 *qt422016.Writer, mn *storage.MetricName) {
//line app/vmselect/prometheus/export.qtpl:155
2019-05-22 21:16:55 +00:00
qw422016.N().Z(mn.MetricGroup)
//line app/vmselect/prometheus/export.qtpl:156
2019-05-22 21:16:55 +00:00
if len(mn.Tags) > 0 {
//line app/vmselect/prometheus/export.qtpl:156
2019-05-22 21:16:55 +00:00
qw422016.N().S(`{`)
//line app/vmselect/prometheus/export.qtpl:158
2019-05-22 21:16:55 +00:00
tags := mn.Tags
//line app/vmselect/prometheus/export.qtpl:159
2019-05-22 21:16:55 +00:00
qw422016.N().Z(tags[0].Key)
//line app/vmselect/prometheus/export.qtpl:159
2019-05-22 21:16:55 +00:00
qw422016.N().S(`=`)
//line app/vmselect/prometheus/export.qtpl:159
2019-05-22 21:16:55 +00:00
qw422016.N().QZ(tags[0].Value)
//line app/vmselect/prometheus/export.qtpl:160
2019-05-22 21:16:55 +00:00
tags = tags[1:]
//line app/vmselect/prometheus/export.qtpl:161
2019-05-22 21:16:55 +00:00
for i := range tags {
//line app/vmselect/prometheus/export.qtpl:162
2019-05-22 21:16:55 +00:00
tag := &tags[i]
//line app/vmselect/prometheus/export.qtpl:162
2019-05-22 21:16:55 +00:00
qw422016.N().S(`,`)
//line app/vmselect/prometheus/export.qtpl:163
2019-05-22 21:16:55 +00:00
qw422016.N().Z(tag.Key)
//line app/vmselect/prometheus/export.qtpl:163
2019-05-22 21:16:55 +00:00
qw422016.N().S(`=`)
//line app/vmselect/prometheus/export.qtpl:163
2019-05-22 21:16:55 +00:00
qw422016.N().QZ(tag.Value)
//line app/vmselect/prometheus/export.qtpl:164
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:164
2019-05-22 21:16:55 +00:00
qw422016.N().S(`}`)
//line app/vmselect/prometheus/export.qtpl:166
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:167
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:167
2019-05-22 21:16:55 +00:00
func writeprometheusMetricName(qq422016 qtio422016.Writer, mn *storage.MetricName) {
//line app/vmselect/prometheus/export.qtpl:167
2019-05-22 21:16:55 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line app/vmselect/prometheus/export.qtpl:167
2019-05-22 21:16:55 +00:00
streamprometheusMetricName(qw422016, mn)
//line app/vmselect/prometheus/export.qtpl:167
2019-05-22 21:16:55 +00:00
qt422016.ReleaseWriter(qw422016)
//line app/vmselect/prometheus/export.qtpl:167
2019-05-22 21:16:55 +00:00
}
//line app/vmselect/prometheus/export.qtpl:167
2019-05-22 21:16:55 +00:00
func prometheusMetricName(mn *storage.MetricName) string {
//line app/vmselect/prometheus/export.qtpl:167
2019-05-22 21:16:55 +00:00
qb422016 := qt422016.AcquireByteBuffer()
//line app/vmselect/prometheus/export.qtpl:167
2019-05-22 21:16:55 +00:00
writeprometheusMetricName(qb422016, mn)
//line app/vmselect/prometheus/export.qtpl:167
2019-05-22 21:16:55 +00:00
qs422016 := string(qb422016.B)
//line app/vmselect/prometheus/export.qtpl:167
2019-05-22 21:16:55 +00:00
qt422016.ReleaseByteBuffer(qb422016)
//line app/vmselect/prometheus/export.qtpl:167
2019-05-22 21:16:55 +00:00
return qs422016
//line app/vmselect/prometheus/export.qtpl:167
2019-05-22 21:16:55 +00:00
}