NH-133385 PHP: investigate rate limiting mechanism in sampler#7
Open
jerrytfleung wants to merge 5 commits intomainfrom
Open
NH-133385 PHP: investigate rate limiting mechanism in sampler#7jerrytfleung wants to merge 5 commits intomainfrom
jerrytfleung wants to merge 5 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for caching token bucket state in addition to sampling settings in the
solarwinds/apm_extPHP extension. It adds a second in-memory cache for bucket state, exposes new APIs for storing and retrieving bucket state, and updates configuration, documentation, and tests accordingly. The changes also include some refactoring and improvements to cache keying and lifecycle management.Major changes:
1. Bucket State Cache Support
bucket_state_cache) for token bucket state, with its own size and value length tunables, managed in module globals (ext/php_apm_ext.h,ext/apm_ext.c). [1] [2] [3] [4] [5]Solarwinds\Cache::getBucketStateandputBucketState, plus corresponding C/C++ bridge and cache logic (ext/apm_ext.c,ext/apm_ext.stub.php,ext/apm_ext_arginfo.h,ext/cache_c_wrapper.h/.cpp,ext/cache.h/.cpp). [1] [2] [3] [4] [5] [6] [7]2. Configuration and Documentation Updates
README.mdand a newAGENTS.mdfile to describe the new cache, APIs, and project rules. [1] [2]3. Cache Keying and API Refactor
4. Cache Lifecycle and Fork Handling
5. Miscellaneous
2.0.0to reflect the new API and cache.These changes provide robust support for caching both sampling settings and token bucket state, with clear separation, configuration, and documentation for each.
Related issues
NH-133385