Gostresslib - A golang library for stress testing.

GoStressLib

A golang library for stress testing.

Install

go get github.com/tenhan/gostresslib

Usage

package main

import (
	"github.com/tenhan/gostresslib/measurer"
	"io"
	"net/http"
)

func main()  {
	m := measurer.NewJobMeasurer()
	total := 10000
	concurrency := 2
	m.Run(total,concurrency,[]string{"response_size(byte)"}, func(num int, metric *measurer.JobMetric) error {
		resp,err := http.Get("http://127.0.0.1:8000/ping")
		if err != nil{
			return err
		}
		defer resp.Body.Close()
		bytes,err := io.ReadAll(resp.Body)
		if err != nil {
			return err
		}
		metric.SetMetricsValue(float64(len(bytes)))
		return nil
	}).Print()
}

output:

GoStressLib version: v1.0.0
Running in 19s882ms(19.882s), count: 10000, concurrency: 4
TPS: 502.962/s

Metric: Latency(s)
Total: 79.483
Avg: 0.008
Min: 0.005
Max: 0.047
Stdev: 0.002
PerSec: 3.998

Metric: Error(count)
Total: 0.000
Avg: 0.000
Min: 0.000
Max: 0.000
Stdev: 0.000
PerSec: 0.000

Metric: response_size(byte)
Total: 40000.000
Avg: 4.000
Min: 4.000
Max: 4.000
Stdev: 3.992
PerSec: 2011.848
Similar Resources

testcase is an opinionated behavior-driven-testing library

Table of Contents testcase Guide Official API Documentation Getting Started / Example Modules Summary DRY Modularization Stability Case Study About te

Nov 10, 2022

HTTP load testing tool and library. It's over 9000!

HTTP load testing tool and library. It's over 9000!

Vegeta Vegeta is a versatile HTTP load testing tool built out of a need to drill HTTP services with a constant request rate. It can be used both as a

Jan 7, 2023

A WebDriver client and acceptance testing library for Go

A WebDriver client and acceptance testing library for Go

Agouti Agouti is a library for writing browser-based acceptance tests in Google Go. It provides Gomega matchers and plays nicely with Ginkgo or Spec.

Dec 26, 2022

Go library for testing async behavior

Helpers for testing async behavior.

Jun 30, 2022

Tesuto - a little library for testing against HTTP services

tesuto import "github.com/guregu/tesuto" tesuto is a little library for testing

Jan 18, 2022

A modern generic testing assertions library for Go

test test is a generics based testing assertions library for Go. There are two packages, test and must. test - assertions that mark the test for failu

Dec 12, 2022

Golang HTTP client testing framework

flute Golang HTTP client testing framework Presentation https://speakerdeck.com/szksh/flute-golang-http-client-testing-framework Overview flute is the

Sep 27, 2022

Extremely flexible golang deep comparison, extends the go testing package and tests HTTP APIs

Extremely flexible golang deep comparison, extends the go testing package and tests HTTP APIs

go-testdeep Extremely flexible golang deep comparison, extends the go testing package. Latest news Synopsis Description Installation Functions Availab

Dec 22, 2022

Testing API Handler written in Golang.

Gofight API Handler Testing for Golang Web framework. Support Framework Http Handler Golang package http provides HTTP client and server implementatio

Dec 16, 2022
Opiniated stress-tester for servers

Gobyoall Opinionated stress-tester for servers. Features: Concurrent requests Reads config-files as well as cli-arguments (viper/cobra). Env-variables

Dec 19, 2021
This is a DNS over TLS stress test tool

This is a DNS over TLS stress test tool

Apr 17, 2022
Package has tool to generate workload for vegeta based kube-api stress tests.

Package has tool to generate workload for vegeta based kube-api stress tests.

Nov 22, 2021
Stupidly fast, completely serverless and infinitely scalable stress tester.
Stupidly fast, completely serverless and infinitely scalable stress tester.

dontstress Stupidly fast, completely serverless and infinitely scalable stress tester. Don't stress over your failing competitive programming task sol

Nov 15, 2021
A yaml data-driven testing format together with golang testing library

Specimen Yaml-based data-driven testing Specimen is a yaml data format for data-driven testing. This enforces separation between feature being tested

Nov 24, 2022
siusiu (suite-suite harmonics) a suite used to manage the suite, designed to free penetration testing engineers from learning and using various security tools, reducing the time and effort spent by penetration testing engineers on installing tools, remembering how to use tools.
siusiu (suite-suite harmonics) a suite used to manage the suite, designed to free penetration testing engineers from learning and using various security tools, reducing the time and effort spent by penetration testing engineers on installing tools, remembering how to use tools.

siusiu (suite-suite harmonics) a suite used to manage the suite, designed to free penetration testing engineers from learning and using various security tools, reducing the time and effort spent by penetration testing engineers on installing tools, remembering how to use tools.

Dec 12, 2022
Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats.
Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats.

Fortio Fortio (Φορτίο) started as, and is, Istio's load testing tool and now graduated to be its own project. Fortio is also used by, among others, Me

Jan 2, 2023
:exclamation:Basic Assertion Library used along side native go testing, with building blocks for custom assertions

Package assert Package assert is a Basic Assertion library used along side native go testing Installation Use go get. go get github.com/go-playground/

Jan 6, 2023
Library created for testing JSON against patterns.

Gomatch Library created for testing JSON against patterns. The goal was to be able to validate JSON focusing only on parts essential in given test cas

Oct 28, 2022
A Go library help testing your RESTful API application

RESTit A Go micro-framework to help writing RESTful API integration test Package RESTit provides helps to those who want to write an integration test

Oct 28, 2022