New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/xujiahua/benchmark_parallel

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/xujiahua/benchmark_parallel

  • v0.0.0-20180328034911-896f991fe124
  • Source
  • Go
  • Socket score

Version published
Created
Source

Why

golang benchmark没有并发测试的支持。

Usage

指定多少个goroutine,即多少个并发用户。指定worker方法,方法签名返回error,用于统计错误率。

import "github.com/XUJiahua/benchmark_parallel"
 
benchmark_parallel.Run(1000, func() error {
		// custom code
		err := something()
		return err
	})

结果打印:并发用户数,错误率,平均耗时。

1000 goroutines, 0 / 1000 error rate, 1832241696 nanoseconds/op

FAQs

Package last updated on 28 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc