utils

package
v0.0.0-...-9b3b26b Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVersionTag

func GetVersionTag() string

Types

type DelayExp2

type DelayExp2 struct {
	Min, Max int
	Value    int
	Unit     time.Duration
}

func (*DelayExp2) After

func (d *DelayExp2) After() <-chan time.Time

func (*DelayExp2) NextValue

func (d *DelayExp2) NextValue() int

func (*DelayExp2) Reset

func (d *DelayExp2) Reset()

func (*DelayExp2) Sleep

func (d *DelayExp2) Sleep()

func (*DelayExp2) SleepWithCancel

func (d *DelayExp2) SleepWithCancel(canceled func() bool)

type Usage

type Usage struct {
	Utime      time.Duration `json:"utime"`
	Stime      time.Duration `json:"stime"`
	Cutime     time.Duration `json:"cutime"`
	Cstime     time.Duration `json:"cstime"`
	NumThreads int           `json:"num_threads"`
	VmSize     int64         `json:"vm_size"`
	VmRss      int64         `json:"vm_rss"`
}

func CPUUsage

func CPUUsage(d time.Duration) (float64, *Usage, error)

func GetUsage

func GetUsage() (*Usage, error)

func (*Usage) CPUTotal

func (u *Usage) CPUTotal() time.Duration

func (*Usage) MemTotal

func (u *Usage) MemTotal() int64

Jump to

Keyboard shortcuts

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