stat

package
v3.0.0-beta-rc.1+incom... Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Stat_Module        = "mem_stat"
	FileNameDateFormat = "20060102150405"
	ShiftedExtension   = ".old"
	PRO_MEM            = "/proc/%d/status"

	F_OK                = 0
	MaxTimeoutLevel     = 3
	DefaultStatInterval = 60                // 60 seconds
	DefaultStatLogSize  = 200 * 1024 * 1024 // 200M
	DefaultHeadRoom     = 50 * 1024         // 50G
	MaxReservedDays     = 7 * 24 * time.Hour
)

Variables

View Source
var DefaultTimeOutUs = [3]uint32{100000, 500000, 1000000}

Functions

func BeginStat

func BeginStat() (bgTime *time.Time)

func ClearStat

func ClearStat()

func CloseStat

func CloseStat()

func EndStat

func EndStat(typeName string, err error, bgTime *time.Time, statCount uint32) error

func GetProcessMemory

func GetProcessMemory(pid int) (Virt, Res uint64, err error)

func StatBandWidth

func StatBandWidth(typeName string, Size uint32)

func WriteStat

func WriteStat() error

Types

type ShiftedFile

type ShiftedFile []os.FileInfo

func (ShiftedFile) Len

func (f ShiftedFile) Len() int

func (ShiftedFile) Less

func (f ShiftedFile) Less(i, j int) bool

func (ShiftedFile) Swap

func (f ShiftedFile) Swap(i, j int)

type Statistic

type Statistic struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewStatistic

func NewStatistic(dir, logModule string, logMaxSize int64, timeOutUs [MaxTimeoutLevel]uint32, useMutex bool) (*Statistic, error)

Jump to

Keyboard shortcuts

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