Documentation ¶
Index ¶
- func CatchError(handle func(e interface{}))
- func GetCpuInfo()
- func GetGoRoutineId() uint64
- func GetIps() ([]string, []string, error)
- func IPToInt64(ip string) int64
- func Int64ToIP(ip int64) string
- func PrintStackTrace(err interface{}) string
- type ByteUnit
- func (bu *ByteUnit) ConvertByBytes(v int64, fu ByteUnit) (res int64, err error)
- func (bu *ByteUnit) ToBytes(v int64) (res int64, err error)
- func (bu *ByteUnit) ToGiB(v int64) (res int64, err error)
- func (bu *ByteUnit) ToKiB(v int64) (res int64, err error)
- func (bu *ByteUnit) ToMiB(v int64) (res int64, err error)
- func (bu *ByteUnit) ToPiB(v int64) (res int64, err error)
- func (bu *ByteUnit) ToTiB(v int64) (res int64, err error)
- type ByteUnitType
- type ClientAddr
- type ClientStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCpuInfo ¶
func GetCpuInfo()
func GetGoRoutineId ¶
func GetGoRoutineId() uint64
获取goroutine id *
- runtime.stack-> goroutine 4 [running]:
- gitee.com/liueric/generic/base.GetGoRouti
- runtime.TrimPrefix-> 4 [running]:
- gitee.com/liueric/generic/base.GetGoRouti
- 4 *
Types ¶
type ByteUnit ¶
type ByteUnit struct {
// contains filtered or unexported fields
}
func (*ByteUnit) ConvertByBytes ¶
type ByteUnitType ¶
type ByteUnitType string
* Power Exact Value Approx Value Bytes --------------------------------------------------------------- 7 128 8 256 10 1024 1 thousand 1 KB 16 65,536 64 KB 20 1,048,576 1 million 1 MB 30 1,073,741,824 1 billion 1 GB 32 4,294,967,296 4 GB 40 1,099,511,627,776 1 trillion 1 TB
const ( BYTE_ ByteUnitType = "byte" KiB_ ByteUnitType = "KiB" MiB_ ByteUnitType = "MiB" GiB_ ByteUnitType = "GiB" TiB_ ByteUnitType = "TiB" PiB_ ByteUnitType = "PiB" )
type ClientAddr ¶
type ClientStatus ¶
type ClientStatus struct { Cpu []float64 `json:cpu` // CPU百分比(%) Host string `json:host` // 主机名称 Ip []string `json:ip` // IP地址信息(可能多个) Ipv6 []string `json:ipv6` // IP地址信息(可能多个) Mac string `json:mac` MemUsed uint64 `json:mem_used` // 内存使用(byte) MemTotal uint64 `json:mem_total` // 内存总量(byte) Time int `json:time` // 上报时间(时间戳) }
Click to show internal directories.
Click to hide internal directories.