Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetEventCost ¶ added in v1.0.0
func SetEventCost(event EventFunc)
SetEventCost 设置输出cost事件. 可以做邮件通知. 钉釘等办公通知
func SetLogCondition ¶ added in v0.2.0
func SetLogCondition(cond ConditionFunc)
SetLogCondition 设置输出cost条件
Types ¶
type ConditionFunc ¶ added in v0.3.0
ConditionFunc 日志输出条件判断函数
func CondGTE ¶ added in v0.3.0
func CondGTE(t time.Duration) ConditionFunc
CondGTE 创建cost>=t时间输出日志的条件
func CondLTE ¶ added in v0.3.0
func CondLTE(t time.Duration) ConditionFunc
CondLTE 创建cost<=t时间输出日志的条件
func CondRange ¶ added in v0.3.0
func CondRange(t1, t2 time.Duration) ConditionFunc
CondRange 创建t1<=cost<=t2时间输出日志的条件
type CostTime ¶
type CostTime struct {
// contains filtered or unexported fields
}
CostTime 消费时间基本结构
func (*CostTime) SetEeventCost ¶ added in v1.0.0
SetEeventCost 设置输出cost事件. 可以做邮件通知. 钉釘等办公通知. 只触发CostLog(). Cost()不触发
func (*CostTime) SetLogCondition ¶ added in v0.4.0
func (c *CostTime) SetLogCondition(cond ConditionFunc)
SetLogCondition 设置输出cost条件
Click to show internal directories.
Click to hide internal directories.