bench

package
v0.0.0-...-2692626 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	Version            string          `json:"version"`
	PprofHttpPort      uint32          `json:"pprofHttpPort"`      //pprof性能分析 http端口 default:0 不使用
	LogLevel           int             `json:"logLevel"`           //日志等级 default:7
	LogAbsPath         string          `json:"logAbsPath"`         //日志绝对路径 default:/data/xxx/log
	GoMaxProcess       int             `json:"goMaxProcess"`       //default:runtime.NumCPU()
	AvailableLoad      uint32          `json:"availableLoad"`      //可用负载, 可用资源数 default:math.MaxUint32
	BusChannelNumber   uint32          `json:"busChannelNumber"`   //事件chan数量. default: libconsts.BusChannelNumberDefault
	ActorChannelNumber uint32          `json:"actorChannelNumber"` //事件chan数量. default: libconsts.ActorChannelNumberDefault
	RunMode            libutil.RunMode `json:"runMode"`            //运行模式 0:release 1:debug default:0,release
}

type Etcd

type Etcd struct {
	Addrs []string      `json:"addrs"`
	TTL   int64         `json:"ttl"`   // ttl 秒 [默认为 libetcd.TtlSecondDefault 秒, e.g.:系统每10秒续约一次,该参数至少为11秒]
	Key   string        `json:"key"`   // ProjectName/EtcdWatchMsgTypeService/zoneID/serviceName/serviceID
	Value EtcdValueJson `json:"value"` // 有:直接使用. default:{"serviceNetTCP":{"ip":"0.0.0.0","port":5101},"version":"Beta.0.0.1","availableLoad":4294967295}
}

type EtcdValueJson

type EtcdValueJson struct {
	ServiceNetTCP ServiceNetJson `json:"serviceNetTCP,omitempty"` //有:直接使用. 没有:使用 server 属性生成ip, port
	Version       string         `json:"version,omitempty"`       //有:直接使用. 没有:使用 base.version 生成
	AvailableLoad uint32         `json:"availableLoad,omitempty"` //可用负载, 可用资源数
}

type Mgr

type Mgr struct {
	Base   Base   `json:"base"`
	Etcd   Etcd   `json:"etcd"`
	Timer  Timer  `json:"timer"`
	Server Server `json:"server"`
}

func GetInstance

func GetInstance() *Mgr

GetInstance 获取

func (*Mgr) Parse

func (p *Mgr) Parse(pathFile string, projectName string, zoneID uint32, serviceName string, serviceID uint32) error

Parse 解析, bench.json

func (*Mgr) String

func (p *Mgr) String() string

String 显示服务信息

type Server

type Server struct {
	IP   string `json:"ip"`
	Port uint16 `json:"port"`
}

type ServiceNetJson

type ServiceNetJson struct {
	IP   string `json:"ip,omitempty"`
	Port uint16 `json:"port,omitempty"`
}

ServiceNetJson 服务 网络 接口

type Timer

type Timer struct {
	//秒级定时器 扫描间隔(纳秒) 1000*1000*100=100000000 为100毫秒 default: pkgconsts.ScanSecondDurationDefault
	ScanSecondDuration *time.Duration `json:"scanSecondDuration"`
	//毫秒级定时器 扫描间隔(纳秒) 1000*1000*100=100000000 为25毫秒 default: pkgconsts.ScanMillisecondDurationDefault
	ScanMillisecondDuration *time.Duration `json:"scanMillisecondDuration"`
}

Jump to

Keyboard shortcuts

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