Documentation
¶
Index ¶
- Constants
- Variables
- func BeginStat() (bgTime *time.Time)
- func ClearStat()
- func CloseStat()
- func EndStat(typeName string, err error, bgTime *time.Time, statCount uint32) error
- func GetMememory() (Virt, Res uint64, err error)
- func GetProcessMemory(pid int) (Virt, Res uint64, err error)
- func RecordStat(partitionID uint64, op string, dataPath string)
- func StatBandWidth(typeName string, Size uint32)
- func WriteStat() error
- type OpLogger
- func (l *OpLogger) Close()
- func (l *OpLogger) GetMasterOps() []*Operation
- func (l *OpLogger) GetPrevOps() []*Operation
- func (l *OpLogger) IsRecordFile() bool
- func (l *OpLogger) IsSendMaster() bool
- func (l *OpLogger) Record(name string)
- func (l *OpLogger) RecordOp(name, op string)
- func (l *OpLogger) SetArgs(reserveTime time.Duration, fileSize int64)
- func (l *OpLogger) SetFileSize(fileSize int64)
- func (l *OpLogger) SetRecordFile(recordFile bool)
- func (l *OpLogger) SetSendMaster(sendMaster bool)
- type Operation
- type ShiftedFile
- type Statistic
Constants ¶
View Source
const ( DefaultMaxOps = 100 DefaultDuration = time.Minute )
View Source
const ( Stat_Module = "mem_stat" FileNameDateFormat = "20060102150405" ShiftedExtension = ".old" PRO_MEM = "/proc/%d/status" F_OK = 0 MaxTimeoutLevel = 3 DefaultStatLogSize = 200 * 1024 * 1024 // 200M DefaultHeadRoom = 50 * 1024 // 50G MaxReservedDays = 7 * 24 * time.Hour )
Variables ¶
View Source
var ( DpStat = new(OpLogger) DiskStat = new(OpLogger) )
View Source
var DefaultStatInterval = 60 * time.Second // 60 seconds
View Source
var DefaultTimeOutUs = [MaxTimeoutLevel]uint32{100000, 500000, 1000000}
Functions ¶
func GetMememory ¶
func GetProcessMemory ¶
func RecordStat ¶
func StatBandWidth ¶
Types ¶
type OpLogger ¶
func NewOpLogger ¶
func (*OpLogger) GetMasterOps ¶
func (*OpLogger) GetPrevOps ¶
func (*OpLogger) IsRecordFile ¶
func (*OpLogger) IsSendMaster ¶
func (*OpLogger) SetFileSize ¶
func (*OpLogger) SetRecordFile ¶
func (*OpLogger) SetSendMaster ¶
type ShiftedFile ¶
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)
Click to show internal directories.
Click to hide internal directories.