mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-03 16:21:14 +01:00
app/vmselect: return +Inf as null in graphite render api (#5009)
Signed-off-by: Konstantin Kulikov <k.kulikov2@gmail.com>
This commit is contained in:
parent
b6ad581b45
commit
f7dda12b4d
@ -47,7 +47,7 @@ See https://graphite.readthedocs.io/en/stable/render_api.html#json
|
|||||||
{% code timestamps := s.Timestamps %}
|
{% code timestamps := s.Timestamps %}
|
||||||
{% for i, v := range s.Values %}
|
{% for i, v := range s.Values %}
|
||||||
[
|
[
|
||||||
{% if math.IsNaN(v) %}null{% else %}{%f= v %}{% endif %},
|
{% if math.IsNaN(v) || math.IsInf(v, 0) %}null{% else %}{%f= v %}{% endif %},
|
||||||
{%dl= timestamps[i]/1e3 %}
|
{%dl= timestamps[i]/1e3 %}
|
||||||
]
|
]
|
||||||
{% if i+1 < len(timestamps) %},{% endif %}
|
{% if i+1 < len(timestamps) %},{% endif %}
|
||||||
|
@ -148,7 +148,7 @@ func streamrenderSeriesJSON(qw422016 *qt422016.Writer, s *series) {
|
|||||||
//line app/vmselect/graphite/render_response.qtpl:48
|
//line app/vmselect/graphite/render_response.qtpl:48
|
||||||
qw422016.N().S(`[`)
|
qw422016.N().S(`[`)
|
||||||
//line app/vmselect/graphite/render_response.qtpl:50
|
//line app/vmselect/graphite/render_response.qtpl:50
|
||||||
if math.IsNaN(v) {
|
if math.IsNaN(v) || math.IsInf(v, 0) {
|
||||||
//line app/vmselect/graphite/render_response.qtpl:50
|
//line app/vmselect/graphite/render_response.qtpl:50
|
||||||
qw422016.N().S(`null`)
|
qw422016.N().S(`null`)
|
||||||
//line app/vmselect/graphite/render_response.qtpl:50
|
//line app/vmselect/graphite/render_response.qtpl:50
|
||||||
|
Loading…
Reference in New Issue
Block a user