metrics
metrics copied to clipboard
POC fast historgam
trafficstars
POC for #461
I moved the code from gist to histogram.lua and kept the old histogram in histogram_old.lua. I keep getting the same result for both histograms on my Intel MacBook. Maybe I did smth wrong?
ho = require('metrics.collectors.histogram_old')
api_timings_hist = ho:new('old')
hf = require('metrics.collectors.histogram')
api_timings_fast = hf:new('new')
clock = require('clock')
tarantool> clock.bench(function() local lbls = {method='api.users.get',ok='true'} local prev = clock.time() for _ = 1, 1e6 do api_timings_hist:observe(clock.time()-prev, lbls) prev = clock.time() end end)
---
- - 34.845349
...
tarantool> clock.bench(function() local lbls = {method='api.users.get',ok='true'} local prev = clock.time() for _ = 1, 1e6 do api_timings_fast:observe(clock.time()-prev, lbls) prev = clock.time() end end)
---
- - 34.938217
...
This pull request is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days