{"id":13342888,"url":"https://github.com/grafana/xk6-grpc","last_synced_at":"2025-10-01T18:32:13.703Z","repository":{"id":150650622,"uuid":"620945558","full_name":"grafana/xk6-grpc","owner":"grafana","description":null,"archived":true,"fork":false,"pushed_at":"2024-01-18T09:54:45.000Z","size":173,"stargazers_count":10,"open_issues_count":0,"forks_count":5,"subscribers_count":16,"default_branch":"main","last_synced_at":"2024-11-14T22:35:22.855Z","etag":null,"topics":["grpc","k6","xk6"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grafana.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-29T17:22:42.000Z","updated_at":"2024-05-21T08:16:22.000Z","dependencies_parsed_at":"2024-01-18T11:06:47.802Z","dependency_job_id":null,"html_url":"https://github.com/grafana/xk6-grpc","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-grpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-grpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-grpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-grpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grafana","download_url":"https://codeload.github.com/grafana/xk6-grpc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234892715,"owners_count":18902907,"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":["grpc","k6","xk6"],"created_at":"2024-07-29T19:30:06.633Z","updated_at":"2025-10-01T18:32:08.408Z","avatar_url":"https://github.com/grafana.png","language":"Go","funding_links":[],"categories":["Performance Testing"],"sub_categories":["gRPC \u0026 Protocol-Specific Testing"],"readme":"# xk6-grpc\n\n\u003e [!WARNING]  \n\u003e Starting k6 version v0.49 the code of the `k6/x/grpc` extension is part of the `k6/net/grpc` of the [main k6 repository](https://github.com/grafana/k6). Please contribute and [open issues there](https://github.com/grafana/k6/issues). This repository is no longer maintained.\n\nThis extension is re-designing of the k6's GRPC module that also should bring new features like GRPC streaming (it's available in the k6 as `k6/experimental/grpc`).\n\nThe extension code copied from the original k6's GRPC module. The module documentation is available [here](https://k6.io/docs/javascript-api/k6-experimental/grpc/).\n\nThe new stream's functionality (more examples you can find in the `examples` folder):\n\n```javascript\nimport { Stream } from 'k6/x/grpc'\n\n// Stream(client, method)\n// - client - already initialized and connected client with the loaded definitions\n// - method - a gRPC method URL to invoke.\nconst stream = new Stream(\n  client,\n  'foo.BarService/sayHello'\n)\n\n// A `stream.on` method adds a new handler for different kind of the events.\n// \n// Currently supported: \n// `data`  - triggered when the server send data to the stream\n// `error` - an error occurs\n// `end`   - triggered when the server has finished sending the data\n// You could register multiple handlers for the same kind event.\nstream.on('data', message =\u003e {\n  // server send data, processing...\n})\n\n// Write data to the stream\nstream.write({ message: 'foo' })\n\n// Signals the server that the client has finished sending the data\nstream.end()\n```\n\n## Requirements\n\n* [Golang 1.19+](https://go.dev/)g\n* [Git](https://git-scm.com/)\n* [xk6](https://github.com/grafana/xk6) (`go install go.k6.io/xk6/cmd/xk6@latest`)\n* [curl](https://curl.se/) (downloading the k6 core's linter rule-set)\n\n\n## Getting started  \n\n1. Build the k6's binary with the module:\n\n  ```shell\n  $ make build\n  ```\n\n2. Run the GRPC demo server in a separated terminal:\n\n  ```shell\n  $ make grpc-server-run\n  ```\n\n3. Run the example:\n\n  ```shell\n  $ ./k6 run examples/grpc_client_streaming.js\n  ```\n\n## Contributing\n\nContributing to this repository is following general k6's [contribution guidelines](https://github.com/grafana/k6/blob/master/CONTRIBUTING.md) since the long-term goal is to merge this extension into the main k6 repository.\n\nHowever, since right now there are two modules, `k6/net/grpc` and `k6/experimental/grpc`, that have similar functionality (the experimental module started as a copy), and not sharing the code, there is a specialty exists that forces us to backport (or forward port) changes to shared functionality (e.g., bug fixes) between modules.\n\nWe don't expect every contributor to do that and are happy to do that for you, but if you want to do that by yourself, you can do that.\n\n### Testing\n\nTo run the test you can use the `make test` target.\n\n### Linting\n\nTo run the linter you can use the `make lint` target.\n\n\u003e [!IMPORTANT]  \n\u003e By default there is golangci-lint config presented. Since the long-term goal is to merge the module back to the grafana/k6 we use the k6's linter rules. The rule set will be downloaded automatically while the first run of the `make lint` or you could do that manually by running `make linter-config`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fxk6-grpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrafana%2Fxk6-grpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fxk6-grpc/lists"}