Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC fast historgam #469

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

POC fast historgam #469

wants to merge 1 commit into from

Conversation

yngvar-antonsson
Copy link
Collaborator

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
...

Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant