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

Make the high water mark shaper better #411

Merged
merged 2 commits into from
May 29, 2017
Merged

Conversation

Vagabond
Copy link
Member

  • If the shaper is in overload and the final message comes in, but no
    further messages arrive for some time, until another message came in,
    the drop count would not be printed. Now we set a timer to ensure it
    prints the drop count after the current second expires.
  • Allow the shaper to take a filter function that allows events that
    would not normally be printed anyway to not be counted against the
    HWM. This means that if you're suppressing supervisor startup messages
    you won't see drop events counted for messages you'd never see
    printed.

* If the shaper is in overload and the final message comes in, but no
  further messages arrive for some time, until another message came in,
  the drop count would not be printed. Now we set a timer to ensure it
  prints the drop count after the current second expires.
* Allow the shaper to take a filter function that allows events that
  would not normally be printed anyway to not be counted against the
  HWM. This means that if you're suppressing supervisor startup messages
  you won't see drop events counted for messages you'd never see
  printed.
Copy link
Member

@jadeallenx jadeallenx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this is awesome work. Had a few requests to use named functions instead of anonymous ones.

fun(_) -> false end;
{true, true} ->
fun({info_report, _GL, {_Pid, std_info, D}}) when is_list(D) ->
lists:member({exited, stopped}, D);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would really like to see this anonymous fun in its own named function - I think it will make the code clearer and any stacktraces more obvious.

false
end;
{false, true} ->
fun({info_report, _GL, {_Pid, std_info, D}}) when is_list(D) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above. Would you please make this its own named function?

false
end;
{true, false} ->
fun({info_report, _GL, {_P, progress, D}}) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@Vagabond
Copy link
Member Author

Reworked as requested.

@jadeallenx
Copy link
Member

👍 Thanks! I think this is great!

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.

2 participants