Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultStatGridNum = int64(5)
)
View Source
const (
DelayInterval = time.Second * 5
)
View Source
const StatInterval = 3 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AVFlow ¶
type AVFlow struct {
VideoBitrate *Bitrate
AudioBitrate *Bitrate
VideoFPS *FPS
AudioFPS *FPS
VideoGop *Gop
VideoDelay *Delay
VideoDuration *Duration
AudioDuration *Duration
}
AVFlow 流统计
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
func NewDuration ¶
func NewDuration() *Duration
func (*Duration) GetDuration ¶
GetDuration only call by stat once every period
type PeriodicStatistic ¶
type PeriodicStatistic struct {
// contains filtered or unexported fields
}
PeriodicStatistic 周期统计工具,滚动统计周期内数据的最大、最小、平均值
func NewPeriodicStatistic ¶
func NewPeriodicStatistic(gridNum, gridPeriod int64) *PeriodicStatistic
NewPeriodicStatistic 创建周期统计对象, gridNum统计格子数量, gridPeriod格子时间长度,单位秒
type ProcStat ¶
type ProcStat struct {
// The process ID.
PID int
// The filename of the executable.
Comm string
// The process state.
State string
// The PID of the parent of this process.
PPID int
// The process group ID of the process.
PGRP int
// The session ID of the process.
Session int
// The controlling terminal of the process.
TTY int
// The ID of the foreground process group of the controlling terminal of
// the process.
TPGID int
// The kernel flags word of the process.
Flags uint
// The number of minor faults the process has made which have not required
// loading a memory page from disk.
MinFlt uint
// The number of minor faults that the process's waited-for children have
// made.
CMinFlt uint
// The number of major faults the process has made which have required
// loading a memory page from disk.
MajFlt uint
// The number of major faults that the process's waited-for children have
// made.
CMajFlt uint
// Amount of time that this process has been scheduled in user mode,
// measured in clock ticks.
UTime uint
// Amount of time that this process has been scheduled in kernel mode,
// measured in clock ticks.
STime uint
// Amount of time that this process's waited-for children have been
// scheduled in user mode, measured in clock ticks.
CUTime uint
// Amount of time that this process's waited-for children have been
// scheduled in kernel mode, measured in clock ticks.
CSTime uint
// For processes running a real-time scheduling policy, this is the negated
// scheduling priority, minus one.
Priority int
// The nice value, a value in the range 19 (low priority) to -20 (high
// priority).
Nice int
// Number of threads in this process.
NumThreads int
// The time the process started after system boot, the value is expressed
// in clock ticks.
Starttime uint64
// Virtual memory size in bytes.
VSize uint64
// Resident set size in pages.
RSS uint64
}
ProcStat process stat from /proc/[pid]/stat
func NewProcStat ¶
NewProcStat 生成一个进程的stat数据
func (ProcStat) ResidentMemory ¶
ResidentMemory returns the resident memory size in bytes.
func (ProcStat) VirtualMemory ¶
VirtualMemory returns the virtual memory size in bytes.
type StreamHandler ¶
type StreamHandler struct {
VideoBitrate uint64
VideoFPS uint32
AudioFPS uint32
VideoGop float64
VideoWidth uint32
VideoHeight uint32
VideoDuration int64
AudioDuration int64
AudioBitrate uint64
VideoDelay int64
}
func (*StreamHandler) VideoDurationDelay ¶
func (sh *StreamHandler) VideoDurationDelay() int64
VideoDurationDelay 视频时长与现实时间的diff,毫秒
Click to show internal directories.
Click to hide internal directories.