apisix icon indicating copy to clipboard operation
apisix copied to clipboard

bugfix(prometheus): the `overhead` should use millisecond units, so it needs to be multiplied by 1000

Open membphis opened this issue 6 years ago • 3 comments

The statistics should use millisecond units, so it needs to be multiplied by 1000.

https://github.com/apache/incubator-apisix/blob/master/apisix/plugins/prometheus/exporter.lua#L113

    overhead = overhead - tonumber(ctx.var.upstream_response_time)
    overhead = overhead * 1000

membphis avatar May 26 '20 13:05 membphis

I wanna fix it.

dabue avatar May 26 '20 13:05 dabue

overhead already has 1000 multiplied, this should be overhead = overhead - tonumber(ctx.var.upstream_response_time) * 1000

JanLi-air avatar May 26 '20 13:05 JanLi-air

@JanLi-air many thx, your way is right. I was wrong

membphis avatar May 26 '20 13:05 membphis