This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [github.com/go-viper/mapstructure/v2](https://redirect.github.com/go-viper/mapstructure) | `v2.3.0` -> `v2.4.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | ### GitHub Vulnerability Alerts #### [GHSA-2464-8j7c-4cjm](https://redirect.github.com/go-viper/mapstructure/security/advisories/GHSA-2464-8j7c-4cjm) ### Summary Use of this library in a security-critical context may result in leaking sensitive information, if used to process sensitive fields. ### Details OpenBao (and presumably HashiCorp Vault) have surfaced error messages from `mapstructure` as follows: |
||
|---|---|---|
| .. | ||
| config | ||
| pkg | ||
| .gitignore | ||
| README.md | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| target.json | ||
README.md
flagd Proxy Profiling
This go module contains a profiling tool for the flagd-proxy. Starting n watchers against a single flag configuration resource to monitor the effects of server load and flag configuration definition size on the response time between a configuration change and all watchers receiving the configuration change.
Pseudo Code
- Parse configuration file referenced as the only startup argument
- Loop for each defined repeat
- Write to the target file using the start configuration
- Start
nwatchers for the resource using a grpc sync definining the selector asfile:TARGET-FILE - Wait for all watchers to receive their first configuration change event (which will contain the full configuration object)
- Flush the change event channel to ensure there are no previous events
- Trigger a configuration change event by writing the end configuration to the target file
- Time how long it takes for all watchers to receive the new configuration
Example
run the flagd-proxy locally (from the project root):
go run flagd-proxy/main.go start --port 8080
run the flagd-proxy-profiler (from the project root):
go run flagd-proxy/tests/loadtest/main.go ./flagd-proxy/tests/loadtest/config/config.json
Once the tests have been run the results can be found in ./flagd-proxy/tests/loadtest/profiling-results.json
Sample Configuration
{
"triggerType": "filepath",
"fileTriggerConfig": {
"startFile":"./start-spec.json",
"endFile":"./config/end-spec.json",
"targetFile":"./target.json"
},
"handlerConfig": {
"filePath": "./target.json",
"outFile":"./profiling-results.json",
"host": "localhost",
"port": 8080,
},
"tests": [
{
"watchers": 10000,
"repeats": 5,
"delay": 2000000000
}
]
}