{"id":23884740,"url":"https://github.com/cachewerk/k6","last_synced_at":"2025-04-09T22:23:53.697Z","repository":{"id":42980280,"uuid":"422677719","full_name":"cachewerk/k6","owner":"cachewerk","description":"k6 load tests for WordPress and WooCommerce.","archived":false,"fork":false,"pushed_at":"2025-01-22T17:28:04.000Z","size":89,"stargazers_count":24,"open_issues_count":5,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-24T00:22:44.394Z","etag":null,"topics":["k6","woocommerce","wordpress"],"latest_commit_sha":null,"homepage":"https://relay.so","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cachewerk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-10-29T18:32:56.000Z","updated_at":"2025-02-09T20:35:02.000Z","dependencies_parsed_at":"2024-05-02T16:54:05.776Z","dependency_job_id":"61e3c570-1c98-49e8-97dd-0cd943974780","html_url":"https://github.com/cachewerk/k6","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/cachewerk%2Fk6","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachewerk%2Fk6/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachewerk%2Fk6/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachewerk%2Fk6/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cachewerk","download_url":"https://codeload.github.com/cachewerk/k6/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248120985,"owners_count":21051062,"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":["k6","woocommerce","wordpress"],"created_at":"2025-01-04T03:17:55.356Z","updated_at":"2025-04-09T22:23:53.671Z","avatar_url":"https://github.com/cachewerk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k6\n\nWe use these scripts to benchmark Object Cache Pro and Relay with various hosting partners.\n\n## Setup\n\nMake sure [k6 is installed](https://k6.io/docs/getting-started/installation/).\n\nAll tests can be run locally using `k6 run` or in the cloud using `k6 cloud`. \n\nWhen Object Cache Pro is installed, custom metrics for [WordPress, Redis and Relay](lib/metrics.js) are automatically collected. \n\n## Tests\n\n### `wp.js`\n\nFetches all WordPress sitemaps and requests random URLs.\n\n```\nk6 run wp.js --env SITE_URL=https://example.com\nk6 run wp.js --vus=100 --duration=10m --env SITE_URL=https://example.com\n```\n\n### `woo-checkout.js`\n\nLoads the homepage, selects and loads a random category, selects a random product and adds it to the cart, loads the cart page and then places an order.\n\n```\nwp option update woocommerce_enable_guest_checkout no --autoload=no\nwp option update woocommerce_enable_signup_and_login_from_checkout yes --autoload=no\n\nk6 run woo-checkout.js --env SITE_URL=https://example.com\n```\n\nBe sure to [reset WooCommerce](#reset-woocommerce) between test runs.\n\n### `woo-customer.js`\n\nLoads the homepage, signs in, views at orders and then their account details.\n\n```\nk6 run woo-customer.js --env SITE_URL=https://example.com\n```\n\nThis script requires [seeded users](#seeding-users).\n\n## Environment variables\n\n### Site URL\n\nYou can pass in the `SITE_URL` to point the traffic at at specific URL.\n\n```\nk6 run wp.js --env SITE_URL=https://example.com\n```\n\n### Project ID\n\nYou can set the k6 Cloud \"Project ID\" using the `PROJECT_ID` environment variable.\n\n```\nk6 cloud wp.js --env PROJECT_ID=123456 --env SITE_URL=https://example.com\n```\n\n### Bypass page caches\n\nTo attempt bypassing page caches without logging in, pass in `BYPASS_CACHE`:\n\n```\nk6 run wp.js --env BYPASS_CACHE=1\n```\n\n## Reset WooCommerce\n\n```\nwp post delete --force $(wp post list --post_type=shop_order --format=ids --posts_per_page=-1)\nwp user delete --yes $(wp user list --role=customer --format=ids --posts_per_page=-1)\nwp cache flush\n```\n\n## Seeding users\n\nLoad tests that run with logged in users, use this seed command to create 100 users:\n\n```\nfor USR_NO in {1..100}; do wp user create \"test${USR_NO}\" \"test${USR_NO}@example.com\" --role=subscriber --user_pass=3405691582; done;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcachewerk%2Fk6","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcachewerk%2Fk6","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcachewerk%2Fk6/lists"}