// 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) }
// 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) }
func (a *Alarm) String() string { return fmt.Sprintf("[%s][%s][%d][%s]", ntime.FormatTs(a.Ts), a.AlarmType, a.AlarmCnt, a.ObjName) }