{"id":20568435,"url":"https://github.com/kyukhin/xk6-tarantool-example","last_synced_at":"2025-10-19T09:42:09.939Z","repository":{"id":81753273,"uuid":"360131078","full_name":"kyukhin/xk6-tarantool-example","owner":"kyukhin","description":"📈 Extended example of xk6-tarantool usage","archived":false,"fork":false,"pushed_at":"2021-05-02T15:33:22.000Z","size":3488,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T04:41:50.562Z","etag":null,"topics":["tarantool-cartridge","xk6","xk6-tarantool"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kyukhin.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}},"created_at":"2021-04-21T10:41:38.000Z","updated_at":"2023-03-05T09:34:55.000Z","dependencies_parsed_at":"2023-05-21T21:30:38.577Z","dependency_job_id":null,"html_url":"https://github.com/kyukhin/xk6-tarantool-example","commit_stats":null,"previous_names":["hackfeed/xk6-tarantool-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyukhin%2Fxk6-tarantool-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyukhin%2Fxk6-tarantool-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyukhin%2Fxk6-tarantool-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyukhin%2Fxk6-tarantool-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kyukhin","download_url":"https://codeload.github.com/kyukhin/xk6-tarantool-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248912043,"owners_count":21182202,"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":["tarantool-cartridge","xk6","xk6-tarantool"],"created_at":"2024-11-16T04:50:17.831Z","updated_at":"2025-10-19T09:42:04.906Z","avatar_url":"https://github.com/kyukhin.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xk6-tarantool-example\n\nПример использования модуля [xk6-tarantool](https://github.com/hackfeed/xk6-tarantool) для системы \nнагрузочного тестирования [k6](https://k6.io).\n\n## Сборка\n\n### Требования\n\nДля того, чтобы использовать данный пример, убедитесь, что у вас установлены:\n\n* [Ansible](https://ansible.com)\n* [ansible-cartridge](https://github.com/tarantool/ansible-cartridge)\n* [Vagrant](https://vagrantup.com)\n* [Docker](https://docker.com)\n* [Cartridge CLI](https://github.com/tarantool/cartridge-cli)\n* [Golang](https://golang.org)\n* [Git](https://git-scm.com)\n\n### Развертка окружения\n\n1. Соберите приложение **Tarantool Cartridge**:\n\n```bash\ncd cars\ncartridge pack --use-docker rpm --version 1.0.0\n```\n\n2. В файле `/ansible/hosts.yml` укажите путь до полученного пакета в переменной `cartridge_package_path`.\n\n3. Поднимите виртуальное окружение и дождитесь настройки виртуальных машин:\n\n```bash\nvagrant up\n```\n\n4. Разверните кластер **Tarantool Cartridge**:\n\n```bash\nansible-playbook -i ansible/hosts.yml ansible/playbook.yml\n```\n\nПосле завершения развертки кластер настроен и готов к работе. Перейдите по адресу [http://localhost:8181](http://localhost:8181) \nи убедитесь, что Ваш кластер настроен так, как на изображении:\n\n![](/images/cluster.png)\n\n5. Разверните средства мониторинга **Grafana + InfluxDB**:\n\n```bash\ndocker-compose up -d\n```\n\nПерейдите по адресу [http://localhost:3000](http://localhost:3000) \nи убедитесь, что Ваш дашборд настроен так, как на изображении:\n\n![](/images/grafana.png)\n\n6. Склонируйте репозиторий `xk6` для сборки `k6` с расширениями:\n\n```bash\ngit clone https://github.com/k6io/xk6.git\ncd xk6\n```\n\n7. Соберите исполняемый файл:\n\n```bash\nCGO_ENABLED=1 go run ./cmd/xk6/main.go build master \\\n    --with github.com/hackfeed/xk6-tarantool \\\n    --with github.com/hackfeed/xk6-tarantool-example/modules/xk6-datagen=$(pwd)/../xk6-tarantool-example/modules/xk6-datagen\n```\n\n8. При необходимости, внесите коррективы в сценарий тестирования `/scenarios/test.js`. Подробнее о написании сценариев смотрите в [документации](https://k6.io/docs/using-k6/)\n\n9. Запустите тестирование:\n\n```bash\n./k6 run --out influxdb=http://localhost:8086/k6  ../xk6-tarantool-example/scenarios/test_scenarios_extended.js\n\n          /\\      |‾‾| /‾‾/   /‾‾/   \n     /\\  /  \\     |  |/  /   /  /    \n    /  \\/    \\    |     (   /   ‾‾\\  \n   /          \\   |  |\\  \\ |  (‾)  | \n  / __________ \\  |__| \\__\\ \\_____/ .io\n\n  execution: local\n     script: ../xk6-tarantool-example/scenarios/test_scenarios_extended.js\n     output: InfluxDBv1 (http://localhost:8086)\n\n  scenarios: (100.00%) 2 scenarios, 200 max VUs, 40s max duration (incl. graceful stop):\n           * conn1test: 10000.00 iterations/s for 10s (maxVUs: 100, exec: conn1test, gracefulStop: 30s)\n           * conn2test: 10000.00 iterations/s for 10s (maxVUs: 100, exec: conn2test, gracefulStop: 30s)\n\nINFO[0000] Run data generation in the background         source=console\nWARN[0000] Insufficient VUs, reached 100 active VUs and cannot initialize more  executor=constant-arrival-rate scenario=conn1test\nWARN[0000] Insufficient VUs, reached 100 active VUs and cannot initialize more  executor=constant-arrival-rate scenario=conn2test\nINFO[0010] Testing complete                              source=console\n\nrunning (10.0s), 000/200 VUs, 96483 complete and 0 interrupted iterations\nconn1test ✓ [======================================] 100/100 VUs  10s  10000 iters/s\nconn2test ✓ [======================================] 100/100 VUs  10s  10000 iters/s\n\n     ✓ is status OK\n\n     █ setup\n\n     █ teardown\n\n   ✓ checks...............: 100.00% ✓ 96483 ✗ 0    \n     data_received........: 0 B     0 B/s\n     data_sent............: 0 B     0 B/s\n     dropped_iterations...: 103517  10318.42/s\n   ✓ iteration_duration...: avg=19.48ms min=66.97µs med=16.02ms max=207.6ms p(90)=33ms p(95)=44.53ms\n     iterations...........: 96483   9617.281382/s\n     vus..................: 200     min=200 max=200\n     vus_max..............: 200     min=200 max=200\n\n```\n\n![](images/dashboard.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyukhin%2Fxk6-tarantool-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyukhin%2Fxk6-tarantool-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyukhin%2Fxk6-tarantool-example/lists"}