flagd/flagd-proxy/tests/loadtest
renovate[bot] cd4604471b
chore(deps): update dependency go to v1.24.1 (#1559)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [go](https://go.dev/)
([source](https://redirect.github.com/golang/go)) | toolchain | minor |
`1.22.9` -> `1.24.1` |

---

### Release Notes

<details>
<summary>golang/go (go)</summary>

###
[`v1.24.1`](https://redirect.github.com/golang/go/compare/go1.24.0...go1.24.1)

###
[`v1.24.0`](https://redirect.github.com/golang/go/compare/go1.23.6...go1.24.0)

###
[`v1.23.7`](https://redirect.github.com/golang/go/compare/go1.23.6...go1.23.7)

###
[`v1.23.6`](https://redirect.github.com/golang/go/compare/go1.23.5...go1.23.6)

###
[`v1.23.5`](https://redirect.github.com/golang/go/compare/go1.23.4...go1.23.5)

###
[`v1.23.4`](https://redirect.github.com/golang/go/compare/go1.23.3...go1.23.4)

###
[`v1.23.3`](https://redirect.github.com/golang/go/compare/go1.23.2...go1.23.3)

###
[`v1.23.2`](https://redirect.github.com/golang/go/compare/go1.23.1...go1.23.2)

###
[`v1.23.1`](https://redirect.github.com/golang/go/compare/go1.23.0...go1.23.1)

###
[`v1.23.0`](https://redirect.github.com/golang/go/compare/go1.22.12...go1.23.0)

###
[`v1.22.12`](https://redirect.github.com/golang/go/compare/go1.22.11...go1.22.12)

###
[`v1.22.11`](https://redirect.github.com/golang/go/compare/go1.22.10...go1.22.11)

###
[`v1.22.10`](https://redirect.github.com/golang/go/compare/go1.22.9...go1.22.10)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-feature/flagd).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNjQuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIwMC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZSJdfQ==-->

---------

Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
2025-03-25 14:55:03 -04:00
..
config test: introduce flagd-proxy profiling tool (#599) 2023-04-13 09:40:00 -04:00
pkg fix(deps): update module buf.build/gen/go/open-feature/flagd/grpc/go to v1.5.1-20240906125204-0a6a901b42e8.1 (#1400) 2024-09-23 10:39:19 -04:00
.gitignore test: introduce flagd-proxy profiling tool (#599) 2023-04-13 09:40:00 -04:00
README.md test: introduce flagd-proxy profiling tool (#599) 2023-04-13 09:40:00 -04:00
go.mod chore(deps): update dependency go to v1.24.1 (#1559) 2025-03-25 14:55:03 -04:00
go.sum chore(deps): update dependency go to v1.24.1 (#1559) 2025-03-25 14:55:03 -04:00
main.go test: introduce flagd-proxy profiling tool (#599) 2023-04-13 09:40:00 -04:00
target.json test: introduce flagd-proxy profiling tool (#599) 2023-04-13 09:40:00 -04:00

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

  1. Parse configuration file referenced as the only startup argument
  2. Loop for each defined repeat
  3. Write to the target file using the start configuration
  4. Start n watchers for the resource using a grpc sync definining the selector as file:TARGET-FILE
  5. Wait for all watchers to receive their first configuration change event (which will contain the full configuration object)
  6. Flush the change event channel to ensure there are no previous events
  7. Trigger a configuration change event by writing the end configuration to the target file
  8. 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 
        }
    ]
}