2020-04-22 16:57:36 +00:00
|
|
|
// Code generated by qtc from "tsdb_status_response.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:1
|
|
|
|
package prometheus
|
|
|
|
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:1
|
|
|
|
import "github.com/VictoriaMetrics/VictoriaMetrics/lib/storage"
|
|
|
|
|
|
|
|
// TSDBStatusResponse generates response for /api/v1/status/tsdb .
|
|
|
|
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:5
|
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:5
|
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:5
|
|
|
|
func StreamTSDBStatusResponse(qw422016 *qt422016.Writer, status *storage.TSDBStatus) {
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:5
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`{"status":"success","data":{"totalSeries":`)
|
2020-04-22 16:57:36 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:9
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().DUL(status.TotalSeries)
|
2020-04-22 16:57:36 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:9
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`,"totalLabelValuePairs":`)
|
2020-04-22 16:57:36 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:10
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().DUL(status.TotalLabelValuePairs)
|
2020-04-22 16:57:36 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:10
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`,"seriesCountByMetricName":`)
|
2020-04-22 16:57:36 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:11
|
2022-06-08 15:43:05 +00:00
|
|
|
streamtsdbStatusEntries(qw422016, status.SeriesCountByMetricName)
|
2020-04-22 16:57:36 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:11
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`,"seriesCountByLabelValuePair":`)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:12
|
|
|
|
streamtsdbStatusEntries(qw422016, status.SeriesCountByLabelValuePair)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:12
|
|
|
|
qw422016.N().S(`,"labelValueCountByLabelName":`)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:13
|
|
|
|
streamtsdbStatusEntries(qw422016, status.LabelValueCountByLabelName)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:13
|
2020-04-22 16:57:36 +00:00
|
|
|
qw422016.N().S(`}}`)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
|
|
|
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2020-04-22 16:57:36 +00:00
|
|
|
func WriteTSDBStatusResponse(qq422016 qtio422016.Writer, status *storage.TSDBStatus) {
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2020-04-22 16:57:36 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2020-04-22 16:57:36 +00:00
|
|
|
StreamTSDBStatusResponse(qw422016, status)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2020-04-22 16:57:36 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
|
|
|
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2020-04-22 16:57:36 +00:00
|
|
|
func TSDBStatusResponse(status *storage.TSDBStatus) string {
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2020-04-22 16:57:36 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2020-04-22 16:57:36 +00:00
|
|
|
WriteTSDBStatusResponse(qb422016, status)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2020-04-22 16:57:36 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2020-04-22 16:57:36 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2020-04-22 16:57:36 +00:00
|
|
|
return qs422016
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
|
|
|
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:18
|
2020-04-22 16:57:36 +00:00
|
|
|
func streamtsdbStatusEntries(qw422016 *qt422016.Writer, a []storage.TopHeapEntry) {
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:18
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`[`)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:20
|
2020-04-22 16:57:36 +00:00
|
|
|
for i, e := range a {
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:20
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`{"name":`)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:22
|
2020-04-22 16:57:36 +00:00
|
|
|
qw422016.N().Q(e.Name)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:22
|
2020-04-22 16:57:36 +00:00
|
|
|
qw422016.N().S(`,"value":`)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:23
|
2020-04-22 16:57:36 +00:00
|
|
|
qw422016.N().D(int(e.Count))
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:23
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`}`)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:25
|
2020-04-22 16:57:36 +00:00
|
|
|
if i+1 < len(a) {
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:25
|
2020-04-22 16:57:36 +00:00
|
|
|
qw422016.N().S(`,`)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:25
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:26
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:26
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`]`)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
|
|
|
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
func writetsdbStatusEntries(qq422016 qtio422016.Writer, a []storage.TopHeapEntry) {
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
streamtsdbStatusEntries(qw422016, a)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
|
|
|
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
func tsdbStatusEntries(a []storage.TopHeapEntry) string {
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
writetsdbStatusEntries(qb422016, a)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
return qs422016
|
2022-06-08 15:43:05 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|