{"id":48744576,"url":"https://github.com/lwlee2608/xk6-diameter","last_synced_at":"2026-05-28T10:04:14.890Z","repository":{"id":205710764,"uuid":"714877127","full_name":"lwlee2608/xk6-diameter","owner":"lwlee2608","description":"A k6 extension for Diameter protocol","archived":false,"fork":false,"pushed_at":"2025-10-15T14:23:57.000Z","size":75,"stargazers_count":23,"open_issues_count":1,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-28T06:08:52.992Z","etag":null,"topics":["diameter","k6","k6-extension","load-testing","performance-testing","xk6"],"latest_commit_sha":null,"homepage":"","language":"Go","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/lwlee2608.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-06T02:52:48.000Z","updated_at":"2026-03-18T03:37:31.000Z","dependencies_parsed_at":"2024-03-31T05:33:57.503Z","dependency_job_id":"590be0ba-b82b-4738-ba34-0465543c42a1","html_url":"https://github.com/lwlee2608/xk6-diameter","commit_stats":null,"previous_names":["matrixxsoftware/xk6-diameter","lwlee2608/xk6-diameter"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lwlee2608/xk6-diameter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lwlee2608%2Fxk6-diameter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lwlee2608%2Fxk6-diameter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lwlee2608%2Fxk6-diameter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lwlee2608%2Fxk6-diameter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lwlee2608","download_url":"https://codeload.github.com/lwlee2608/xk6-diameter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lwlee2608%2Fxk6-diameter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33603475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["diameter","k6","k6-extension","load-testing","performance-testing","xk6"],"created_at":"2026-04-12T10:00:24.383Z","updated_at":"2026-05-28T10:04:14.884Z","avatar_url":"https://github.com/lwlee2608.png","language":"Go","funding_links":[],"categories":["Protocols"],"sub_categories":["Diameter"],"readme":"# k6 Extension for Diameter\n\n## Overview\n\nThis extension adds support for the Diameter protocol to [k6](https://k6.io/).\n\n## Build\n\n```bash\nmake\n```\nThe Makefile will automatically download [xk6](https://github.com/grafana/xk6), which is required to compile this project.\n\n## Example\n\n```js\nimport diam from 'k6/x/diameter'\nimport avp from 'k6/x/diameter/avp'\nimport dict from 'k6/x/diameter/dict'\nimport { cmd, app, code, flag, vendor } from './diam/const.js'\nimport { check } from 'k6'\n\nlet data = diam.DataType()\n\nlet client = diam.Client({\n    authApplicationId: [app.ChargingControl],\n})\n\nexport default function () {\n    client.connect(\"localhost:3868\")\n\n    let ccr = diam.newRequest(cmd.CreditControl, app.ChargingControl);\n    ccr.add(avp.New(code.OriginHost,         0,     0,       data.DiameterIdentity(\"origin.host\")))\n    ccr.add(avp.New(code.OriginRealm,        0,     0,       data.DiameterIdentity(\"origin.realm\")))\n    ccr.add(avp.New(code.DestinationHost,    0,     0,       data.DiameterIdentity(\"dest.host\")))\n    ccr.add(avp.New(code.DestinationRealm,   0,     0,       data.DiameterIdentity(\"dest.realm\")))\n    ccr.add(avp.New(code.SessionId,          0,     flag.M,  data.UTF8String(\"Session-8888\")))\n    ccr.add(avp.New(code.CCRequestType,      0,     flag.M,  data.Enumerated(1)))\n    ccr.add(avp.New(code.CCRequestNumber,    0,     flag.M,  data.Unsigned32(1000)))\n    ccr.add(avp.New(code.SubscriptionId,     0,     flag.M,  data.Grouped([\n        avp.New(code.SubscriptionIdData,     0,     flag.M,  data.UTF8String(\"subs-data\")),\n        avp.New(code.SubscriptionIdType,     0,     flag.M,  data.Enumerated(1))\n    ])))\n    ccr.add(avp.New(code.ServiceInformation, 10415, flag.M,  data.Grouped([\n        avp.New(code.PSInformation,          10415, flag.M,  data.Grouped([\n            avp.New(code.CalledStationId,    0,     flag.M,  data.UTF8String(\"10099\"))\n        ]))\n    ])))\n\n    const cca = client.send(ccr)\n    console.log(`CCA: ${cca}`)\n\n    const resultCode = cca.findAVP(code.ResultCode, 0)\n    check(resultCode, {'Result-Code == 2001': r =\u003e r == 2001,})\n}\n```\n\nUse your custom k6 binary to run an example k6 script.\n```bash\n./bin/k6 run example/example.js\n```\n\n## Docker\nAlternatively, you may run xk6-diameter packaged in Docker using the following command:\n```bash\ndocker run \\\n  --net=host \\\n  -v $(pwd)/example:/mnt/example \\\n  ghcr.io/matrixxsoftware/xk6-diameter run --log-format=raw /mnt/example/example.js  \n```\n\n## Generator\n\nThere are thousands of AVPs, each with a unique avp-code and vendor-id. To aid readability and enhance the developer experience, we recommend defining them as constants in a separate file, for example, using `diam/const.js`.\n\nYou can either create the constant yourself or use the bin/dict_generator CLI tool to generate a full list of AVPs for you. Use the following command:\n```bash\n./bin/dict_generator -output example/diam/const.js\n```\n\nThe CLI also supports generating additional AVPs that are not defined in the default list. Simply add the -dictionary flag to include the additional AVP definition:\n```bash\n./bin/dict_generator -output example/diam/const.js -dictionary dict/extra.xml\n```\n\nConfigurations\n\n## Configuration Options\n\n### Diameter Config\n\n| Field Name                  | Type         | Description                                                                |\n|-----------------------------|--------------|----------------------------------------------------------------------------|\n| RequestTimeout              | duration     | Timeout for each request                                                   |\n| MaxRetransmits              | number       | Maximum number of message retransmissions                                  |\n| RetransmitInterval          | duration     | Interval between message retransmissions                                   |\n| EnableWatchdog              | boolean      | Flag to enable automatic DWR (Diameter Watchdog Request)                   |\n| WatchdogInterval            | duration     | Interval between sending DWRs                                              |\n| WatchdogStream              | number       | Stream ID for sending DWRs (for multistreaming protocols)                  |\n| SupportedVendorID           | number array | List of supported vendor IDs                                               |\n| AcctApplicationID           | number array | List of accounting application IDs                                         |\n| AuthApplicationID           | number array | List of authentication application IDs                                     |\n| VendorSpecificApplicationID | object       | List of vendor-specific application IDs                                    |\n| CapabilityExchange          | object       | Configuration for capability exchange                                      |\n| TransportProtocol           | string       | Transport layer protocol to use, either \"tcp\" or \"sctp\". Defaults to \"tcp\" |\n| TLS                         | object       | TLS Configuration                                                          |\n\n### Vendor Specific Application Id Config\n| Field Name        | Type   | Description         |\n|-------------------|--------|---------------------|\n| VendorID          | number | Vendor ID           |\n| AuthApplicationID | number | Auth Application ID |\n| AcctApplicationID | number | Acct Application ID |\n\n### Capability Exchange Config\n\n| Field Name                     | Type                          | Description                                           |\n| ------------------------------ | ----------------------------- | ----------------------------------------------------- |\n| VendorID                       | number                        | Vendor ID                                             |\n| ProductName                    | string                        | Name of the product                                   |\n| OriginHost                     | string                        | Host name of the origin                               |\n| OriginRealm                    | string                        | Realm of the origin                                   |\n| FirmwareRevision               | number                        | Firmware revision number                              |\n| HostIPAddresses                | string array                  | List of host IP addresses                             |\n\n### TLS Config\n| Field Name | Type    | Description                        |\n| ---------- | ------- | ---------------------------------- |\n| Enable     | boolean | Use TLS encrypted connection       |\n| Cert       | String  | TLS certificate file, can be empty |\n| Key        | String  | TLS private key file, can be empty |\n\n### Example\nThe following example demonstrates how to create a Diameter client in k6 with various configuration options.\n\n```js\nlet client = diam.Client({\n    requestTimeout: \"50ms\",\n    enableWatchdog: false,\n    authApplicationId: [app.ChargingControl],\n    vendorSpecificApplicationId: [\n        {\n            authApplicationId: app.ChargingControl,\n            vendorId: vendor.TGPP,\n        }\n    ],\n    capabilityExchange: {\n        vendorId: 35838,\n    },\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flwlee2608%2Fxk6-diameter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flwlee2608%2Fxk6-diameter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flwlee2608%2Fxk6-diameter/lists"}