Twirp RPC Support

I know that K6 supports gRPC, however, we are using a lighter-weight framework called Twirp and we would like to replicate our traffic as closely as possible.

There are a number of differences, such as gRPC uses http/2 to determine what endpoint is used whereas Twirp uses a URL path. Twirp supports JSON serialisation and can run on http/1.1 as well as http/2. GitHub - twitchtv/twirp: A simple RPC framework with protobuf service definitions

Twirp mainly supports a Go implementation although there are a number of Javascript implementations too.

Has anybody mashed these two together?

Hi @Viola !

Welcome to the community forums! :wave:

Has anybody mashed these two together?

The short answer is yes. There is a closed PR that even tried to bring this into the k6. But unfortunately, it was not accepted, and there are some rational explanations in the comment.

However, as mentioned there, the Twirp support can be done via xk6 extension.

Let me know if that answers,
Cheers

Thanks for getting back to me so quickly on this @olegbespalov
So essentially we need what the PR contained, however, just as an xK6 extension. It does make sense to keep support for less commonly used protocols as extensions.

I will keep you posted with how this goes!

Viola

1 Like