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

[DX-687] Update drl_threshold config option description #5546

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

Conversation

zalbiraw
Copy link
Member

@zalbiraw zalbiraw commented Sep 8, 2023

Update drl_threshold config option description to include turning off the fallback algos

Description

Related Issue

Motivation and Context

How This Has Been Tested

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring or add test (improvements in base code or adds test coverage to functionality)

Checklist

  • I ensured that the documentation is up to date
  • I explained why this PR updates go.mod in detail with reasoning why it's required
  • I would like a code coverage CI quality gate exception and have explained why

@zalbiraw zalbiraw requested a review from dcs3spp September 8, 2023 19:59
@zalbiraw zalbiraw changed the title Update drl_threshold config option description [DX-687] Update drl_threshold config option description Sep 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

API Changes

--- prev.txt	2023-09-08 19:59:30.800567165 +0000
+++ current.txt	2023-09-08 19:59:21.160140914 +0000
@@ -4504,9 +4504,9 @@
 	DRLNotificationFrequency int `json:"drl_notification_frequency"`
 
 	// A distributed rate limiter is inaccurate on small rate limits, and it will fallback to a Redis or Sentinel rate limiter on an individual user basis, if its rate limiter lower then threshold.
-	// A Rate limiter threshold calculated using the following formula: `rate_threshold = drl_threshold * number_of_gateways`.
+	// A Rate limiter threshold is calculated using the following formula: `rate_threshold = drl_threshold * number_of_gateways`.
 	// So you have 2 Gateways, and your threshold is set to 5, if a user rate limit is larger than 10, it will use the distributed rate limiter algorithm.
-	// Default: 5
+	// If the threashold value is set to lower than 0 then the fallback is disabled and DRL will be used regardless of the rate limit. Default: 5.
 	DRLThreshold float64 `json:"drl_threshold"`
 
 	// Controls which algorthm to use as a fallback when your distributed rate limiter can't be used.
@@ -5095,7 +5095,7 @@
 	// This option should only be used when moving an installation to a new database.
 	AllowExplicitPolicyID bool `json:"allow_explicit_policy_id"`
 	// This option is used for storing a policies  if `policies.policy_source` is set to `file`.
-	// it should be some existing directory path on hard drive
+	// it should be some existing file path on hard drive
 	PolicyPath string `json:"policy_path"`
 }
 
@@ -8870,9 +8870,6 @@
 func (p *ReverseProxy) CheckCircuitBreakerEnforced(spec *APISpec, req *http.Request) (bool, *ExtendedCircuitBreakerMeta)
 
 func (p *ReverseProxy) CheckHardTimeoutEnforced(spec *APISpec, req *http.Request) (bool, float64)
-    CheckHardTimeoutEnforced checks APISpec versions for a fine grained timeout
-    value. The value is defined in seconds, but we're using float64 to enable
-    sub-second durations for tests. Changing to int would break that behaviour.
 
 func (p *ReverseProxy) CheckHeaderInRemoveList(hdr string, spec *APISpec, req *http.Request) bool
 
@@ -10555,15 +10552,14 @@
 	Cookies         []*http.Cookie    `json:",omitempty"`
 	Delay           time.Duration     `json:",omitempty"`
 	BodyMatch       string            `json:",omitempty"` // regex
+	BodyMatchFunc   func([]byte) bool `json:",omitempty"`
 	BodyNotMatch    string            `json:",omitempty"`
 	HeadersMatch    map[string]string `json:",omitempty"`
 	HeadersNotMatch map[string]string `json:",omitempty"`
 	JSONMatch       map[string]string `json:",omitempty"`
 	ErrorMatch      string            `json:",omitempty"`
-
-	BodyMatchFunc func([]byte) bool `json:"-"`
-	BeforeFn      func()            `json:"-"`
-	Client        *http.Client      `json:"-"`
+	BeforeFn        func()            `json:"-"`
+	Client          *http.Client      `json:"-"`
 
 	AdminAuth      bool `json:",omitempty"`
 	ControlRequest bool `json:",omitempty"`

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

PR Analysis

  • 🎯 Main theme: Updating the description of the drl_threshold configuration option
  • 📝 PR summary: This PR updates the description of the drl_threshold configuration option in the config.go file. The updated description now includes information about disabling the fallback algorithm by setting the threshold value to less than 0.
  • 📌 Type of PR: Documentation
  • 🧪 Relevant tests added: No
  • 🔒 Security concerns: No

PR Feedback

  • 💡 General suggestions: The PR is straightforward and focuses on updating a comment in the code. It's always good to see improvements in code documentation, as it helps maintainers and other developers understand the code better. However, it would be beneficial if the PR also included updates to any user-facing documentation that references this configuration option.

  • 🤖 Code feedback:

How to use

To invoke the PR-Agent, add a comment using one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback.
/ask <QUESTION>: Pose a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented Sep 8, 2023

API tests result: success
Branch used: refs/pull/5546/merge
Commit:
Triggered by: pull_request (@zalbiraw)
Execution page

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