Refactoring: exporter add ump

Signed-off-by: awzhgw <guowl18702995996@gmail.com>
This commit is contained in:
awzhgw 2019-08-03 23:30:07 +08:00 committed by awzhgw
parent b376e01732
commit 669df1f3d7
2 changed files with 3 additions and 9 deletions

View File

@ -478,7 +478,7 @@ func (dp *DataPartition) streamRepairExtent(remoteExtentInfo *storage.ExtentInfo
reply := repl.NewPacket()
// read 64k streaming repair packet
if err = reply.ReadFromConn(conn, proto.ReadDeadlineTime); err != nil {
if err = reply.ReadFromConn(conn, 60); err != nil {
err = errors.Trace(err, "streamRepairExtent receive data error")
log.LogErrorf("action[streamRepairExtent] err(%v).", err)
return

View File

@ -71,20 +71,14 @@ func (tp *TimePoint) Set() {
func NewTPCnt(name string) (tpc *TimePointCount) {
tpc = new(TimePointCount)
if !enabled {
tpc.to = ump.BeforeTP(fmt.Sprintf("%v_%v_%v", clustername, modulename, name))
return
}
tpc.to = ump.BeforeTP(fmt.Sprintf("%v_%v_%v", clustername, modulename, name))
tpc.tp = NewTP(name)
tpc.cnt = NewCounter(fmt.Sprintf("%s_count", name))
return
}
func (tpc *TimePointCount) Set(err error) {
if !enabled {
ump.AfterTP(tpc.to, err)
return
}
ump.AfterTP(tpc.to, err)
tpc.tp.Set()
tpc.cnt.Add(1)
}