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

More gc enforcement policies #1808

Merged
merged 1 commit into from Sep 21, 2018

Conversation

@spring2maz
Copy link
Contributor

spring2maz commented Sep 9, 2018

No description provided.

@spring2maz spring2maz force-pushed the more-gc-enforcement-policies branch 8 times, most recently from cb112fe to 2eb4d48 Sep 9, 2018
@spring2maz spring2maz force-pushed the more-gc-enforcement-policies branch 2 times, most recently from 57872d5 to 5c76426 Sep 10, 2018
@coveralls

This comment has been minimized.

Copy link

coveralls commented Sep 13, 2018

Pull Request Test Coverage Report for Build 3247

  • 43 of 47 (91.49%) changed or added relevant lines in 3 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.5%) to 55.561%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/emqx_connection.erl 12 13 92.31%
src/emqx_session.erl 9 10 90.0%
src/emqx_gc.erl 22 24 91.67%
Files with Coverage Reduction New Missed Lines %
src/emqx_connection.erl 1 58.52%
src/emqx_session.erl 1 69.96%
Totals Coverage Status
Change from base Build 3230: 0.5%
Covered Lines: 2278
Relevant Lines: 4100

💛 - Coveralls
@spring2maz spring2maz force-pushed the more-gc-enforcement-policies branch from 5c76426 to 955b789 Sep 18, 2018
@spring2maz

This comment has been minimized.

Copy link
Contributor Author

spring2maz commented Sep 18, 2018

rebase

%% @doc Minimal interval in seconds to force connection/session process GC
{mapping, "mqtt.conn.force_gc_interval", "emqx.conn_force_gc_interval", [
{datatype, integer}
]}.

This comment has been minimized.

Copy link
@emqplus

emqplus Sep 19, 2018

Contributor

Combine the three options to one 'zone..force_gc_policy':

{mapping, "zone.$name.force_gc_policy", "emqx.conn_force_gc_count", [
   {default, "Interval|Count|Bytes"},
   {datatype, string}
 ]}.

This comment has been minimized.

Copy link
@emqplus

emqplus Sep 19, 2018

Contributor

Translate the 'force_gc_policy' to a map:

lists:to_map(lists:zip([interval, count, bytes],
                                    [list_to_integer(Token) || Token <- string:tokens("Interval|Count|Bytes", "|")]))
The implementation prior to this commit supports
only one gc enforcement policy which is message count threshold.
The new implementation introduces 1 more: volume threshold based
@spring2maz spring2maz force-pushed the more-gc-enforcement-policies branch from 955b789 to e940c1c Sep 19, 2018
@spring2maz

This comment has been minimized.

Copy link
Contributor Author

spring2maz commented Sep 19, 2018

fixed review comments.

@emqplus emqplus self-assigned this Sep 21, 2018
@emqplus emqplus added the Enhancement label Sep 21, 2018
@emqplus emqplus added this to the 3.0-beta.3 milestone Sep 21, 2018
@emqplus

This comment has been minimized.

Copy link
Contributor

emqplus commented Sep 21, 2018

Merge the PR first. The emqx_gc should be a parameterized module.

@emqplus emqplus merged commit 721f237 into emqx30 Sep 21, 2018
3 checks passed
3 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.5%) to 55.561%
Details
@spring2maz

This comment has been minimized.

Copy link
Contributor Author

spring2maz commented Sep 21, 2018

parameterized module is not supported (not officially) since otp 21
do we really want to add it with an ugly hack ?

@spring2maz spring2maz deleted the more-gc-enforcement-policies branch Sep 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.