target

package
v0.0.0-...-3c654f8 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

package target provides the stress server for performance testing

Index

Constants

This section is empty.

Variables

View Source
var (
	StressClusterToken = "stress_etcd_cluster"
)

Functions

func StartHTTPTarget

func StartHTTPTarget(cfg Config) error

Start HTTP target by providing target configurations

Types

type Config

type Config struct {
	// <addr>:<port> to bind target
	BindAddress string
	// if print log periodically
	PrintLog bool
	// signal channel for SIGHUP
	Sighup chan os.Signal
	// if enable etcd
	EnableEtcd bool
	// etcd server config
	Etcd server.Config
}

Config is the config settings for stress target

type StatsListener

type StatsListener struct {
	net.Listener
	ConnNumber uint64
}

StatsListener records listener related stats including connection number it is a wrapper of net.Listener

func StatsListen

func StatsListen(addr string) (*StatsListener, error)

StatsListen creats StatsListener internally creates a tcp4 net.Listener

func (*StatsListener) Accept

func (l *StatsListener) Accept() (net.Conn, error)

Accept wraps origin Accept method and records connection number

Jump to

Keyboard shortcuts

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