mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
2ac5f00d98
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/891 This commit also adds `"isPartial":{true|false}` field to `/api/v1/*` responses. `"isPartial":true` is set when the response is based on a partial data because some of vmstorage nodes weren't available during query processing.
67 lines
2.7 KiB
Go
67 lines
2.7 KiB
Go
// Code generated by qtc from "metrics_index_response.qtpl". DO NOT EDIT.
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
// MetricsIndexResponse generates response for /metrics/index.json .See https://graphite-api.readthedocs.io/en/latest/api.html#metrics-index-json
|
|
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:5
|
|
package graphite
|
|
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:5
|
|
import (
|
|
qtio422016 "io"
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
)
|
|
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:5
|
|
var (
|
|
_ = qtio422016.Copy
|
|
_ = qt422016.AcquireByteBuffer
|
|
)
|
|
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:5
|
|
func StreamMetricsIndexResponse(qw422016 *qt422016.Writer, isPartial bool, metricNames []string, jsonp string) {
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:6
|
|
if jsonp != "" {
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:6
|
|
qw422016.N().S(jsonp)
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:6
|
|
qw422016.N().S(`(`)
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:6
|
|
}
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:7
|
|
streammetricPaths(qw422016, metricNames)
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:8
|
|
if jsonp != "" {
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:8
|
|
qw422016.N().S(`)`)
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:8
|
|
}
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:9
|
|
}
|
|
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:9
|
|
func WriteMetricsIndexResponse(qq422016 qtio422016.Writer, isPartial bool, metricNames []string, jsonp string) {
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:9
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:9
|
|
StreamMetricsIndexResponse(qw422016, isPartial, metricNames, jsonp)
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:9
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:9
|
|
}
|
|
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:9
|
|
func MetricsIndexResponse(isPartial bool, metricNames []string, jsonp string) string {
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:9
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:9
|
|
WriteMetricsIndexResponse(qb422016, isPartial, metricNames, jsonp)
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:9
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:9
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:9
|
|
return qs422016
|
|
//line app/vmselect/graphite/metrics_index_response.qtpl:9
|
|
}
|