2019-06-10 15:55:20 +00:00
|
|
|
{% import "github.com/VictoriaMetrics/VictoriaMetrics/lib/storage" %}
|
|
|
|
|
|
|
|
{% stripspace %}
|
2020-09-26 01:29:45 +00:00
|
|
|
LabelsCountResponse generates response for /api/v1/labels/count .
|
2020-11-14 10:36:21 +00:00
|
|
|
{% func LabelsCountResponse(isPartial bool, labelEntries []storage.TagEntry) %}
|
2019-06-10 15:55:20 +00:00
|
|
|
{
|
|
|
|
"status":"success",
|
2020-11-14 10:36:21 +00:00
|
|
|
"isPartial":{% if isPartial %}true{% else %}false{% endif %},
|
2019-06-10 15:55:20 +00:00
|
|
|
"data":{
|
|
|
|
{% for i, e := range labelEntries %}
|
|
|
|
{%q= e.Key %}:{%d= len(e.Values) %}
|
|
|
|
{% if i+1 < len(labelEntries) %},{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{% endfunc %}
|
|
|
|
|
|
|
|
{% endstripspace %}
|