Example #1
0
// status calc
func monitor() {
	startTs := time.Now().Unix()
	_monitor()
	endTs := time.Now().Unix()
	log.Printf("monitor, startTs %s, time-consuming %d sec\n", ntime.FormatTs(startTs), endTs-startTs)

	// statistics
	proc.MonitorCronCnt.Incr()
	proc.MonitorCronCnt.PutOther("lastStartTs", ntime.FormatTs(startTs))
	proc.MonitorCronCnt.PutOther("lastTimeConsumingInSec", endTs-startTs)
}
Example #2
0
// status calc
func monitor() {
	startTs := time.Now().Unix()
	_monitor()
	endTs := time.Now().Unix()
	log.Printf("monitor, startTs %s, time-consuming %d sec\n", ntime.FormatTs(startTs), endTs-startTs)

	// statistics
	pfc.Meter("MonitorCronCnt", 1)
	pfc.Gauge("MonitorCronTs", endTs-startTs)
}
Example #3
0
func (a *Alarm) String() string {
	return fmt.Sprintf("[%s][%s][%d][%s]", ntime.FormatTs(a.Ts), a.AlarmType, a.AlarmCnt, a.ObjName)
}