Documentation ¶
Index ¶
- type CallSnapshot
- type CallSnapshotPlus
- type MomentStatsItem
- type MomentStatsItemSet
- type StatsItem
- func (statsItem *StatsItem) GetStatsDataInDay() *StatsSnapshot
- func (statsItem *StatsItem) GetStatsDataInHour() *StatsSnapshot
- func (statsItem *StatsItem) GetStatsDataInMinute() *StatsSnapshot
- func (statsItem *StatsItem) Init()
- func (statsItem *StatsItem) PrintAtDay()
- func (statsItem *StatsItem) PrintAtHour()
- func (statsItem *StatsItem) PrintAtMinutes()
- func (statsItem *StatsItem) SamplingInHour()
- func (statsItem *StatsItem) SamplingInMinutes()
- func (statsItem *StatsItem) SamplingInSeconds()
- type StatsItemSet
- func (stats *StatsItemSet) AddValue(statsKey string, incValue, incTimes int64)
- func (stats *StatsItemSet) GetAndCreateStatsItem(statsKey string) *StatsItem
- func (stats *StatsItemSet) GetStatsDataInDay(statsKey string) *StatsSnapshot
- func (stats *StatsItemSet) GetStatsDataInHour(statsKey string) *StatsSnapshot
- func (stats *StatsItemSet) GetStatsDataInMinute(statsKey string) *StatsSnapshot
- func (stats *StatsItemSet) GetStatsItem(statsKey string) *StatsItem
- func (stats *StatsItemSet) Init()
- type StatsSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallSnapshot ¶
type CallSnapshot struct { Timestamp int64 `json:"timestamp"` Times int64 `json:"times"` Value int64 `json:"value"` }
CallSnapshot Call Snapshot Author rongzhihong Since 2017/9/19
type CallSnapshotPlus ¶
type CallSnapshotPlus struct { CsList []CallSnapshot sync.RWMutex }
CallSnapshotPlus Call Snapshot安全数组 Author rongzhihong Since 2017/9/19
func NewCallSnapshotPlus ¶
func NewCallSnapshotPlus() *CallSnapshotPlus
func (*CallSnapshotPlus) Get ¶
func (csp *CallSnapshotPlus) Get(index int) CallSnapshot
func (*CallSnapshotPlus) Put ¶
func (csp *CallSnapshotPlus) Put(callSnapshot CallSnapshot)
func (*CallSnapshotPlus) Remove ¶
func (csp *CallSnapshotPlus) Remove(index int) bool
func (*CallSnapshotPlus) Size ¶
func (csp *CallSnapshotPlus) Size() int
type MomentStatsItem ¶
type MomentStatsItem struct { ValueCounter int64 `json:"valueCounter"` StatsName string `json:"statsName"` StatsKey string `json:"statsKey"` }
MomentStatsItem MomentStatsItem Author rongzhihong Since 2017/9/19
func NewMomentStatsItem ¶
func NewMomentStatsItem() *MomentStatsItem
NewMomentStatsItem 初始化结构体 Author rongzhihong Since 2017/9/19
func (*MomentStatsItem) Init ¶
func (item *MomentStatsItem) Init()
Init 初始化 Author rongzhihong Since 2017/9/19
type MomentStatsItemSet ¶
type MomentStatsItemSet struct { sync.RWMutex StatsName string `json:"statsName"` StatsItemTable map[string]*MomentStatsItem `json:"statsItemTable"` MomentStatsTaskTickers *timeutil.Tickers // broker统计的定时任务 }
MomentStatsItemSet QueueId@Topic@Group的offset落后数量的记录集合 Author rongzhihong Since 2017/9/17
func NewMomentStatsItemSet ¶
func NewMomentStatsItemSet(statsName string) *MomentStatsItemSet
NewMomentStatsItemSet 初始化 Author rongzhihong Since 2017/9/17
func (*MomentStatsItemSet) GetAndCreateStatsItem ¶
func (moment *MomentStatsItemSet) GetAndCreateStatsItem(statsKey string) *MomentStatsItem
GetAndCreateStatsItem GetAndCreateStatsItem Author rongzhihong Since 2017/9/19
func (*MomentStatsItemSet) SetValue ¶
func (moment *MomentStatsItemSet) SetValue(statsKey string, value int64)
SetValue statsKey的数值加value Author rongzhihong Since 2017/9/19
type StatsItem ¶
type StatsItem struct { ValueCounter int64 `json:"valueCounter"` // 具体的统计值 TimesCounter int64 `json:"timesCounter"` // 统计次数 CsListMinute *CallSnapshotPlus `json:"csListMinute"` // 最近一分钟内的镜像,数量6,10秒钟采样一次 CsListHour *CallSnapshotPlus `json:"csListHour"` // 最近一小时内的镜像,数量6,10分钟采样一次 CsListDay *CallSnapshotPlus `json:"csListDay"` // 最近一天内的镜像,数量24,1小时采样一次 StatsName string `json:"statsName"` StatsKey string `json:"statsKey"` }
StatsItem 统计单元 Author rongzhihong Since 2017/9/19
func NewStatsItem ¶
func NewStatsItem() *StatsItem
NewStatsItem 统计单元初始化 Author rongzhihong Since 2017/9/19
func (*StatsItem) GetStatsDataInDay ¶
func (statsItem *StatsItem) GetStatsDataInDay() *StatsSnapshot
GetStatsDataInDay 获得天统计数据 Author rongzhihong Since 2017/9/19
func (*StatsItem) GetStatsDataInHour ¶
func (statsItem *StatsItem) GetStatsDataInHour() *StatsSnapshot
GetStatsDataInDay 获得小时统计数据 Author rongzhihong Since 2017/9/19
func (*StatsItem) GetStatsDataInMinute ¶
func (statsItem *StatsItem) GetStatsDataInMinute() *StatsSnapshot
GetStatsDataInDay 获得分钟统计数据 Author rongzhihong Since 2017/9/19
func (*StatsItem) Init ¶
func (statsItem *StatsItem) Init()
Init 统计单元初始化 Author rongzhihong Since 2017/9/19
func (*StatsItem) PrintAtDay ¶
func (statsItem *StatsItem) PrintAtDay()
PrintAtDay 输出天统计 Author rongzhihong Since 2017/9/19
func (*StatsItem) PrintAtHour ¶
func (statsItem *StatsItem) PrintAtHour()
PrintAtHour 输出小时统计 Author rongzhihong Since 2017/9/19
func (*StatsItem) PrintAtMinutes ¶
func (statsItem *StatsItem) PrintAtMinutes()
PrintAtMinutes 输出分钟统计 Author rongzhihong Since 2017/9/19
func (*StatsItem) SamplingInHour ¶
func (statsItem *StatsItem) SamplingInHour()
SamplingInHour 小时统计单元 Author rongzhihong Since 2017/9/19
type StatsItemSet ¶
type StatsItemSet struct { sync.RWMutex StatsName string StatsItemTable map[string]*StatsItem // key: statsKey, val:StatsItem StatsItemTickers *timeutil.Tickers // broker统计的定时任务 }
StatsItemSet 统计单元集合 Author rongzhihong Since 2017/9/19
func NewStatsItemSet ¶
func NewStatsItemSet(statsName string) *StatsItemSet
NewStatsItemSet 初始化某个统计维度的统计单元集合 Author rongzhihong Since 2017/9/19
func (*StatsItemSet) AddValue ¶
func (stats *StatsItemSet) AddValue(statsKey string, incValue, incTimes int64)
AddValue statsKey的统计单元数量增加 Author rongzhihong Since 2017/9/19
func (*StatsItemSet) GetAndCreateStatsItem ¶
func (stats *StatsItemSet) GetAndCreateStatsItem(statsKey string) *StatsItem
GetAndCreateStatsItem 创建、获得statsKey的统计单元 Author rongzhihong Since 2017/9/19
func (*StatsItemSet) GetStatsDataInDay ¶
func (stats *StatsItemSet) GetStatsDataInDay(statsKey string) *StatsSnapshot
GetStatsDataInDay 获得statsKey每天统计数据 Author rongzhihong Since 2017/9/19
func (*StatsItemSet) GetStatsDataInHour ¶
func (stats *StatsItemSet) GetStatsDataInHour(statsKey string) *StatsSnapshot
GetStatsDataInHour 获得statsKey每小时统计数据 Author rongzhihong Since 2017/9/19
func (*StatsItemSet) GetStatsDataInMinute ¶
func (stats *StatsItemSet) GetStatsDataInMinute(statsKey string) *StatsSnapshot
GetStatsDataInMinute 获得statsKey每分钟统计数据 Author rongzhihong Since 2017/9/19
func (*StatsItemSet) GetStatsItem ¶
func (stats *StatsItemSet) GetStatsItem(statsKey string) *StatsItem
NewStatsItemSet 获得statsKey的统计单元 Author rongzhihong Since 2017/9/19
func (*StatsItemSet) Init ¶
func (stats *StatsItemSet) Init()
Init 统计单元集合初始化 Author rongzhihong Since 2017/9/19
type StatsSnapshot ¶
type StatsSnapshot struct { Sum int64 `json:"sum"` Tps float64 `json:"tps"` Avgpt float64 `json:"avgpt"` }
StatsSnapshot Stats Snapshot Author rongzhihong Since 2017/9/19
func NewStatsSnapshot ¶
func NewStatsSnapshot() *StatsSnapshot
NewStatsSnapshot 初始化 Author rongzhihong Since 2017/9/19