{"id":13342858,"url":"https://github.com/yjuba/xk6-dns","last_synced_at":"2025-03-12T02:32:49.990Z","repository":{"id":47558703,"uuid":"398734684","full_name":"yjuba/xk6-dns","owner":"yjuba","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-24T05:07:00.000Z","size":32,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-30T21:05:27.696Z","etag":null,"topics":["xk6"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yjuba.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}},"created_at":"2021-08-22T06:55:39.000Z","updated_at":"2024-02-02T21:54:11.000Z","dependencies_parsed_at":"2022-08-26T19:25:10.692Z","dependency_job_id":null,"html_url":"https://github.com/yjuba/xk6-dns","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/yjuba%2Fxk6-dns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjuba%2Fxk6-dns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjuba%2Fxk6-dns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjuba%2Fxk6-dns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yjuba","download_url":"https://codeload.github.com/yjuba/xk6-dns/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221265583,"owners_count":16788059,"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":["xk6"],"created_at":"2024-07-29T19:30:06.265Z","updated_at":"2024-10-24T02:30:37.955Z","avatar_url":"https://github.com/yjuba.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"xk6-dns\n=====\n\nThis is a [k6](https://github.com/k6io/k6) extension using the\n[xk6](https://github.com/k6io/xk6) system.\n\n## Build\n\nTo build a `k6` binary with this plugin, first ensure you have the prerequisites:\n\n- [Go toolchain](https://go101.org/article/go-toolchain.html)\n- If you're using SQLite, a build toolchain for your system that includes `gcc` or\n  another C compiler. On Debian and derivatives install the `build-essential`\n  package. On Windows you can use [tdm-gcc](https://jmeubank.github.io/tdm-gcc/).\n  Make sure that `gcc` is in your `PATH`.\n- Git\n\nThen:\n\n1. Install `xk6`:\n  ```shell\n  go install github.com/k6io/xk6/cmd/xk6@latest\n  ```\n\n2. Build the binary:\n  ```shell\n  xk6 build v0.33.0 --with github.com/yjuba/xk6-dns\n  ```\n\n## Example\n\n```javascript\n// example.js\nimport dns from 'k6/x/dns';\n\nexport let options = {\n    discardResponseBodies: true,\n    scenarios: {\n        my_awesome_dns_test: {\n            executor: 'constant-vus',\n            vus: 1,\n            duration: '5s',\n        },\n    },\n};\n\nexport default function () {\n    dns.setReadTimeout('1s');\n    dns.resolve('127.0.0.1:53', 'example.com.', 'A');\n}\n```\n\nResult output:\n\n```shell\n$ ./k6 run example.js\n\n          /\\      |??| /??/   /??/\n     /\\  /  \\     |  |/  /   /  /\n    /  \\/    \\    |     (   /   ??\\\n   /          \\   |  |\\  \\ |  (?)  |\n  / __________ \\  |__| \\__\\ \\_____/ .io\n\n  execution: local\n     script: example.js\n     output: -\n\n  scenarios: (100.00%) 1 scenario, 1 max VUs, 35s max duration (incl. graceful stop):\n           * my_awesome_dns_test: 1 looping VUs for 5s (gracefulStop: 30s)\n\n\nrunning (05.0s), 0/1 VUs, 1938 complete and 0 interrupted iterations\nmy_awesome_api_test ↓ [======================================] 1 VUs  5s\n\n     data_received........: 87 kB 17 kB/s\n     data_sent............: 56 kB 11 kB/s\n     dns.dial.count.......: 1938  387.409151/s\n     dns.request.count....: 1938  387.409151/s\n     dns.response.rtt.....: avg=2.04ms min=0s       med=1ms   max=356ms    p(90)=1ms    p(95)=1ms\n     iteration_duration...: avg=2.56ms min=794.36μs med=1.5ms max=357.11ms p(90)=1.64ms p(95)=1.68ms\n     iterations...........: 1938  387.409151/s\n     vus..................: 1     min=1        max=1\n     vus_max..............: 1     min=1        max=1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjuba%2Fxk6-dns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyjuba%2Fxk6-dns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjuba%2Fxk6-dns/lists"}