package
1.12.6
Repository: https://github.com/go-dev-frame/sponge.git
Documentation: pkg.go.dev

# README

benchmark

Compression testing of rpc methods and generation of reported results.

Example of use

import "github.com/go-dev-frame/sponge/pkg/grpc/benchmark"

func benchmarkExample() error {
	host := "127.0.0.1:8282"
	protoFile := "api/serverNameExample/v1/userExample.proto"
	// if third-party dependencies are missing during the press test, copy them to the project's third_party directory (not including the import path)
	importPaths := []string{"third_party"}
	message := &serverNameV1.GetUserExampleByIDRequest{
		ID: 2,
	}

	b, err := benchmark.New(host, protoFile, "GetByID", message, 1000, importPaths...)
	if err != nil {
		return err
	}
	return b.Run()
}

Once the crush is complete, copy the output html file path to your browser to view the detailed crush report.

# Functions

New create a pressure test instance invalid parameter total if the option runner.WithRunDuration is set.

# Interfaces

Runner interface.

# Type aliases

No description provided by the author