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
|
2022-06-09 16:46:26 +00:00
|
|
|
import (
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/querytracer"
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/storage"
|
|
|
|
)
|
2020-04-22 16:57:36 +00:00
|
|
|
|
|
|
|
// TSDBStatusResponse generates response for /api/v1/status/tsdb .
|
|
|
|
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:8
|
2020-04-22 16:57:36 +00:00
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:8
|
2020-04-22 16:57:36 +00:00
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:8
|
|
|
|
func StreamTSDBStatusResponse(qw422016 *qt422016.Writer, status *storage.TSDBStatus, qt *querytracer.Tracer) {
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:8
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`{"status":"success","data":{"totalSeries":`)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:12
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().DUL(status.TotalSeries)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:12
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`,"totalLabelValuePairs":`)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:13
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().DUL(status.TotalLabelValuePairs)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:13
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`,"seriesCountByMetricName":`)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:14
|
2022-06-08 15:43:05 +00:00
|
|
|
streamtsdbStatusEntries(qw422016, status.SeriesCountByMetricName)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:14
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`,"seriesCountByLabelValuePair":`)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:15
|
2022-06-08 15:43:05 +00:00
|
|
|
streamtsdbStatusEntries(qw422016, status.SeriesCountByLabelValuePair)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:15
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`,"labelValueCountByLabelName":`)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2022-06-08 15:43:05 +00:00
|
|
|
streamtsdbStatusEntries(qw422016, status.LabelValueCountByLabelName)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:16
|
2022-06-09 16:46:26 +00:00
|
|
|
qw422016.N().S(`}`)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:18
|
|
|
|
qt.Done()
|
|
|
|
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:19
|
|
|
|
streamdumpQueryTrace(qw422016, qt)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:19
|
|
|
|
qw422016.N().S(`}`)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:21
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
|
|
|
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:21
|
|
|
|
func WriteTSDBStatusResponse(qq422016 qtio422016.Writer, status *storage.TSDBStatus, qt *querytracer.Tracer) {
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:21
|
2020-04-22 16:57:36 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:21
|
|
|
|
StreamTSDBStatusResponse(qw422016, status, qt)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:21
|
2020-04-22 16:57:36 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:21
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
|
|
|
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:21
|
|
|
|
func TSDBStatusResponse(status *storage.TSDBStatus, qt *querytracer.Tracer) string {
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:21
|
2020-04-22 16:57:36 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:21
|
|
|
|
WriteTSDBStatusResponse(qb422016, status, qt)
|
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:21
|
2020-04-22 16:57:36 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:21
|
2020-04-22 16:57:36 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:21
|
2020-04-22 16:57:36 +00:00
|
|
|
return qs422016
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:21
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
|
|
|
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:23
|
2020-04-22 16:57:36 +00:00
|
|
|
func streamtsdbStatusEntries(qw422016 *qt422016.Writer, a []storage.TopHeapEntry) {
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:23
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`[`)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:25
|
2020-04-22 16:57:36 +00:00
|
|
|
for i, e := range a {
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:25
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`{"name":`)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:27
|
2020-04-22 16:57:36 +00:00
|
|
|
qw422016.N().Q(e.Name)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:27
|
2020-04-22 16:57:36 +00:00
|
|
|
qw422016.N().S(`,"value":`)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2020-04-22 16:57:36 +00:00
|
|
|
qw422016.N().D(int(e.Count))
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:28
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`}`)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:30
|
2020-04-22 16:57:36 +00:00
|
|
|
if i+1 < len(a) {
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:30
|
2020-04-22 16:57:36 +00:00
|
|
|
qw422016.N().S(`,`)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:30
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:31
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:31
|
2022-06-08 15:43:05 +00:00
|
|
|
qw422016.N().S(`]`)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:33
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
|
|
|
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:33
|
2020-04-22 16:57:36 +00:00
|
|
|
func writetsdbStatusEntries(qq422016 qtio422016.Writer, a []storage.TopHeapEntry) {
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:33
|
2020-04-22 16:57:36 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:33
|
2020-04-22 16:57:36 +00:00
|
|
|
streamtsdbStatusEntries(qw422016, a)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:33
|
2020-04-22 16:57:36 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:33
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|
|
|
|
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:33
|
2020-04-22 16:57:36 +00:00
|
|
|
func tsdbStatusEntries(a []storage.TopHeapEntry) string {
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:33
|
2020-04-22 16:57:36 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:33
|
2020-04-22 16:57:36 +00:00
|
|
|
writetsdbStatusEntries(qb422016, a)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:33
|
2020-04-22 16:57:36 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:33
|
2020-04-22 16:57:36 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:33
|
2020-04-22 16:57:36 +00:00
|
|
|
return qs422016
|
2022-06-09 16:46:26 +00:00
|
|
|
//line app/vmselect/prometheus/tsdb_status_response.qtpl:33
|
2020-04-22 16:57:36 +00:00
|
|
|
}
|