utils

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DrainMode   int64
	InstanceHex string
)
View Source
var (
	// StartedAt serve started time
	StartedAt int64

	// OpCt Operation command count statistics
	OpCt        = make([]int, constant.TotalOps)
	AllJobsUsed int64
	ReadyCt     int64
	TimeoutCt   uint64

	CurConnCt     uint64
	CurWorkerCt   uint64
	CurProducerCt uint64
	TotalConnCt   uint64

	GlobalState = model.State{}
)
View Source
var (
	Port                  = flag.Int("p", constant.DefaultPort, "listen on port (default is 11400)")
	BingLogDir            = flag.String("b", "", "write-ahead log directory")                                                                                                           // binlog dir
	FsyncMs               = flag.Int64("f", constant.DefaultFsyncMs, "fsync at most once every MS milliseconds (default is 50ms);use -f0 for \"always fsync\"")                         // fsync binlog ms
	FsyncNever            = flag.Bool("F", true, "never fsync")                                                                                                                         // never fsync
	ListenAddr            = flag.String("l", constant.DefaultListenAddr, "listen on address (default is 0.0.0.0)")                                                                      // server listen addr
	User                  = flag.String("u", "", "become user and group")                                                                                                               // become user and group
	MaxJobSize            = flag.Int64("z", constant.DefaultMaxJobSize, "set the maximum job size in bytes (default is 65535);max allowed is 1073741824 bytes")                         // max job size
	EachWriteAheadLogSize = flag.Int64("s", constant.DefaultFileSize, "set the size of each write-ahead log file (default is 10485760);will be rounded up to a multiple of 4096 bytes") // each write ahead log size
	ShowVersion           = flag.Bool("v", false, "show version information")                                                                                                           // show version
	Verbosity             = flag.Bool("V", false, "increase verbosity")                                                                                                                 // increase verbosity
	LogLevel              = flag.String("L", "warn", "set the log level, switch one in (panic, fatal, error, warn, waring, info, debug, trace)")
)
View Source
var Log = logger.New("beanstalkd")
View Source
var Version string

Functions

func IsValidTube

func IsValidTube(name []byte) bool

isValidTube

func OptParse

func OptParse(s *model.Server)

func ReadDuration

func ReadDuration(buf []byte, idx *int) (int64, error)

func ReadInt

func ReadInt(buf []byte, idx *int) (int64, error)

func ReadTubeName

func ReadTubeName(buf []byte, idx *int) ([]byte, error)

func StrLen

func StrLen(s []byte) int

func StrSpn

func StrSpn(str1 []byte) int

StrSpn

func StrTol

func StrTol(str []byte) (int64, error)

func ToStr

func ToStr(s []byte) string

Types

type Rusage

type Rusage struct {
	Usec  int64
	Ssec  int64
	Total int64
}

Rusage

func Getrusage

func Getrusage() *Rusage

Getrusage

type SysInfo

type SysInfo struct {
	SysName  string
	NodeName string
	Release  string
	Version  string
	Machine  string
}

SysName

func GetSysInfo

func GetSysInfo() *SysInfo

GetSysInfo

Jump to

Keyboard shortcuts

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