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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(limiter): simplify limiter configuration #10625

Merged
merged 2 commits into from May 9, 2023

Conversation

lafirest
Copy link
Member

@lafirest lafirest commented May 6, 2023

Fixes EMQX-9813

after this refactor, the way to set node-level setting changed to:

limiter {
  max_conn_rate = "1000/s"  
  messages_rate = "100/s"
  bytes_rate = "100MB/s"
}

for listener-level:

listeners.tcp.default {
  max_conn_rate = "1000/s"  
  messages_rate = "100/s"
  bytes_rate = "100MB/s"
}

Summary

馃 Generated by Copilot at 65228ec

Added a new HTTP API endpoint and a short path configuration feature for the node-level and listener-level rate limiter settings. Modified the emqx_limiter_schema, emqx_schema, and emqx_listeners modules to support the new features. Added and updated the i18n files for the limiter settings. Added test cases for the short path configuration feature.

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

  • Added tests for the changes
  • Changed lines covered in coverage report
  • Change log has been added to changes/{ce,ee}/(feat|perf|fix)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • If there should be document changes, a PR to emqx-docs.git is sent, or a jira ticket is created to follow up
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • If changed package build workflow, pass this action (manual trigger)
  • Change log has been added to changes/ dir for user-facing artifacts update

@lafirest lafirest force-pushed the refactor/limiter_cfg branch 2 times, most recently from 68d7087 to c60b57e Compare May 6, 2023 09:13
@lafirest lafirest marked this pull request as ready for review May 6, 2023 09:42
@lafirest lafirest requested review from a team and sstrigler as code owners May 6, 2023 09:43
@coveralls
Copy link
Collaborator

coveralls commented May 6, 2023

Pull Request Test Coverage Report for Build 4911194714

  • 22 of 29 (75.86%) changed or added relevant lines in 5 files are covered.
  • 29 unchanged lines in 12 files lost coverage.
  • Overall coverage increased (+0.03%) to 81.622%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/emqx_management/src/emqx_mgmt_api_configs.erl 1 8 12.5%
Files with Coverage Reduction New Missed Lines %
apps/emqx_gateway/src/emqx_gateway_schema.erl 1 88.89%
apps/emqx_management/src/emqx_mgmt_util.erl 1 13.79%
apps/emqx/src/emqx_listeners.erl 1 85.71%
apps/emqx/src/emqx_message.erl 1 94.83%
apps/emqx/src/emqx_schema.erl 1 87.5%
apps/emqx/src/emqx_broker.erl 2 87.64%
apps/emqx/src/emqx_channel.erl 2 87.33%
apps/emqx/src/emqx_connection.erl 2 85.39%
apps/emqx/src/emqx_trace/emqx_trace.erl 2 88.18%
apps/emqx/src/emqx_flapping.erl 3 83.64%
Totals Coverage Status
Change from base Build 4910639718: 0.03%
Covered Lines: 26111
Relevant Lines: 31990

馃挍 - Coveralls

@HJianBo HJianBo changed the base branch from master to release-50 May 9, 2023 03:33
Copy link
Member

@HJianBo HJianBo left a comment

Choose a reason for hiding this comment

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

LGTM

@lafirest lafirest merged commit b94290d into emqx:release-50 May 9, 2023
152 checks passed
@lafirest lafirest deleted the refactor/limiter_cfg branch May 9, 2023 03:40
@@ -0,0 +1,4 @@
Simplify limiter configuration.
- Reduce the complexity of the limiter's configuration.
e.g. now users can use `limiter.messages_rate = 1000/s` to quickly set the node-level limit for the message publish.
Copy link
Member

Choose a reason for hiding this comment

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

limiter.messages_rate = "1000/s"

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