Documentation ¶
Index ¶
- Constants
- func BlankString(str string) bool
- func BytesToString(data []byte) string
- func BytesToUint64(bytes []byte) uint64
- func ClearPidFile() error
- func Fields(data []byte) [][]byte
- func GenTestMessage(length int) string
- func GetIntFromArgs(args map[string]interface{}, arg string, defaultVar int) (int, error)
- func GetPid() (int, error)
- func LocateLineIdx(prefix, data []byte) int
- func StringToBytes(str string) []byte
- func Uint64ToBytes(u uint64) []byte
- func ValidParam(str string) bool
- func WritePid() error
- func WritePidWithVal(pid int) error
- type BenchmarkTester
- type BufferedLineReader
- type Conn
- type Int32Slice
- type LineReader
- type Listener
- type TesterClean
- type TesterTask
Constants ¶
View Source
const ( CR = '\r' LF = '\n' )
View Source
const (
FIELDS_BUFFER = 8
)
Variables ¶
This section is empty.
Functions ¶
func BlankString ¶
func BytesToString ¶
String force casts a []byte to a string. Used as hack for string() when str is used as temp val
func BytesToUint64 ¶
func ClearPidFile ¶
func ClearPidFile() error
func GenTestMessage ¶
func GetIntFromArgs ¶
func LocateLineIdx ¶
locate the "\r\n" index out of data. be carefull the '\r' may be in prefix, and '\n' be in data
func StringToBytes ¶
func Uint64ToBytes ¶
func ValidParam ¶
func WritePidWithVal ¶
Types ¶
type BenchmarkTester ¶
type BenchmarkTester struct { Count int64 // contains filtered or unexported fields }
func NewBenchmarkTester ¶
func NewBenchmarkTester(concurrentLevel int, duration int, task TesterTask, clean TesterClean) *BenchmarkTester
func (*BenchmarkTester) Run ¶
func (bt *BenchmarkTester) Run() error
type BufferedLineReader ¶
type BufferedLineReader struct {
// contains filtered or unexported fields
}
func NewBufferedLineReader ¶
func NewBufferedLineReader(r io.Reader, size int) *BufferedLineReader
func (*BufferedLineReader) ReadLine ¶
func (b *BufferedLineReader) ReadLine() ([]byte, error)
func (*BufferedLineReader) Reset ¶
func (b *BufferedLineReader) Reset()
type Int32Slice ¶
type Int32Slice []int32
func (Int32Slice) Len ¶
func (slice Int32Slice) Len() int
func (Int32Slice) Less ¶
func (slice Int32Slice) Less(i, j int) bool
func (Int32Slice) Swap ¶
func (slice Int32Slice) Swap(i, j int)
type LineReader ¶
type TesterClean ¶
type TesterClean func(bt *BenchmarkTester)
type TesterTask ¶
type TesterTask func(bt *BenchmarkTester, index int) error
Click to show internal directories.
Click to hide internal directories.