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

Address hdr_histogram issues #162

Merged
merged 6 commits into from
Feb 6, 2019
Merged

Conversation

gomoripeti
Copy link
Collaborator

  • Switch back to upstream hdr_histogram 0.3.2
    It already contains some fixes missing from our fork
  • Add native Erlang implementation of hdr_histogram
  • OS env var to choose between NIF or native Erlang implementation
    As the Erlang version is somewhat slower (not measured precisely) the NIF is the default

fixes #86

- Ceil/floor compatibility with pre OTP 20 versions

- No named table even for concurrent access

  The table id is stored in the #hist{} struct (which is shared with all
  updating processes) anyway, so no need for a registered name.  This is
  a minor optimisation to avoid name->tid lookup. (Working with tids was
  slightly optimised in OTP 20 when they became references instead of
  integers)

- One table and one entry per histogram

  Create one table and one entry when initialising the histogram.
  Delete the whole table when deleting the histogram.

Compatibility with hdr_histogram_erl NIF

- Use erlang:make_tuple when reseting row

  This avoids creating a huge temporary list. Reset is called relatively
  infrequently, so this change does not have too big impact.

- OPT: calculate bucket/subbucket index from index

- Collect multiple stats in single iteration
Store pid/regname of event handler process in application env.

A message in the form `{snapshost, NowTime}` is sent to the event
handler when a snaphost is created.

The testcases subscribe themselves as event handlers making them
synchornous and bit less prone to timing issues.

So far this is only used for tests but could be the start of a
websocket-based notification system.
@gomoripeti gomoripeti merged commit 0777759 into Appliscale:release_2.0 Feb 6, 2019
@gomoripeti gomoripeti deleted the hist branch February 6, 2019 21:11
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.

None yet

3 participants