protobuf

package module
v0.0.0-...-14874cd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 8 Imported by: 0

README

xk6-protobuf

A k6 extension for decoding and encoding proto files. Built using xk6.

Setup and Running

Follow these steps to set up and run the K6 benchmark with Protobuf support:

1. Install go

Installing Go toolchain

2. Export the Go PATH

Add the Go binary directory to your system's PATH environment variable:

export PATH=$(go env GOPATH)/bin:$PATH
2. Install xk6

Install the latest version of xk6:

go install go.k6.io/xk6/cmd/xk6@latest
3. Build

Build the K6 binary with the xk6-protobuf extension:

xk6 build --with github.com/traveltime-dev/xk6-protobuf@latest

If you want to build it locally, then clone this repository and use:

xk6 build --with xk6-protobuf=.
4. Run

Run the K6 benchmark using the generated binary and the protobuf benchmark file:

./k6 run {proto-benchmark-file}.js

Replace {proto-benchmark-file}.js with the actual file name of your protobuf benchmark script.

Examples

Command to run examples: ./k6 run example/codec.js

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProtoFile

type ProtoFile struct {
	// contains filtered or unexported fields
}

func (*ProtoFile) Decode

func (p *ProtoFile) Decode(decodedBytes []byte) string

func (*ProtoFile) Encode

func (p *ProtoFile) Encode(data string) []byte

type Protobuf

type Protobuf struct{}

func (*Protobuf) Load

func (p *Protobuf) Load(protoFilePath, lookupType string) ProtoFile

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL