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