Menu
Open source
Client.loadProtoset(protosetPath)
Caution
Starting on k6
v0.49
, the experimental modulek6/experimental/grpc
has been graduated, and its functionality is now available in thek6/net/grpc
module. Thek6/experimental/grpc
is deprecated and will be removed inv0.51.0
.To migrate your scripts, replace all
k6/experimental/grpc
imports withk6/net/grpc
.
Loads and parses the protoset file (serialized FileDescriptor set) so they are available to the client to marshal/unmarshal the correct request and response data structures for the RPC schema.
Must be called within the init
phase.
Parameter | Type | Description |
---|---|---|
protosetPath | string | The path of the protoset file. If no import paths are provided then “.” (current directory) is assumed to be the only import path. |
Examples
JavaScript
import grpc from 'k6/experimental/grpc';
const client = new grpc.Client();
client.loadProtoset('./dummy.protoset');
Was this page helpful?
Related documentation
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
Video
Performance testing and observability in Grafana Cloud
In this webinar, learn how Grafana Cloud k6 offers you the best developer experience for performance testing.
User-centered observability: load testing, real user monitoring, and synthetics
Learn how to use load testing, synthetic monitoring, and real user monitoring (RUM) to understand end users' experience of your apps. Watch on demand.