{"id":19865644,"url":"https://github.com/openfaas/openfaas-autoscaler-tests","last_synced_at":"2025-09-04T18:20:54.348Z","repository":{"id":84492732,"uuid":"535740584","full_name":"openfaas/openfaas-autoscaler-tests","owner":"openfaas","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-04T14:10:04.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-11T15:46:24.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openfaas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-12T15:50:27.000Z","updated_at":"2023-06-29T07:32:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d1850ed-d6a4-4f2e-b141-6e8d95cfc0ba","html_url":"https://github.com/openfaas/openfaas-autoscaler-tests","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fopenfaas-autoscaler-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fopenfaas-autoscaler-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fopenfaas-autoscaler-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fopenfaas-autoscaler-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openfaas","download_url":"https://codeload.github.com/openfaas/openfaas-autoscaler-tests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241275101,"owners_count":19937307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T15:23:33.815Z","updated_at":"2025-02-28T23:28:04.213Z","avatar_url":"https://github.com/openfaas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenFaaS autoscaler tests\nA collection of [K6.io](https://k6.io/) tests to verify autoscaling behaviour.\n\n## Running tests\nDeploy the required functions to run these tests. They are intended to run with this [stack of testing functions](https://github.com/alexellis/autoscaling-functions).\n\nClone this repo and deploy the reference functions in the `stack.yml` file.\n```bash\nfaas-cli deploy\n```\n\nTest capacity based scaling with a load spike.\n```bash\nexport OPENFAAS_URL=\"\"\n\nk6 run tests/spike-capacity.js\n```\n\n## Collect test result in prometheus\nK6 supports sending test result metrics to a Prometheus remote write endpoint. This can be useful to compare test results with the collected OpenFaaS metrics.\n\n\u003e See [the docs](https://k6.io/docs/results-visualization/prometheus/) for more info.\n\nWriting test results to prometheus requires you to build the k6 binary with the [xk6-output-prometheus-remote extension.](https://github.com/grafana/xk6-output-prometheus-remote).\n\n```sh\n# Install xk6\ngo install go.k6.io/xk6/cmd/xk6@latest\n\n# Build the k6 binary\nxk6 build --with github.com/grafana/xk6-output-prometheus-remote\n```\n\n### Enable remote write receiver for OpenFaaS prometheus\nCurrently there is no option in the OpenFaaS chart to add extra arguments to the prometheus command.\n\nEdit the OpenFaaS prometheus deployment and add `--web.enable-remote-write-receiver` to the command in the container spec.\n\n```sh\nkubectl edit -n openfaas deploy/prometheus\n```\n\n```yaml\nspec:\n  containers:\n  - command:\n    - prometheus\n    - --config.file=/etc/prometheus/prometheus.yml\n    - --web.enable-remote-write-receiver\n    image: prom/prometheus:v2.38.0\n```\n\n### Run tests\n```bash\nexport K6_PROMETHEUS_REMOTE_URL=\"http://127.0.0.1:9090/api/v1/write\"\nexport OPENFAAS_URL=\"http://127.0.0.1:8080\"\n\n./k6 run tests/spike-capacity.js -o output-prometheus-remote\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfaas%2Fopenfaas-autoscaler-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfaas%2Fopenfaas-autoscaler-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfaas%2Fopenfaas-autoscaler-tests/lists"}