mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
Refactoring: exporter add ump
Signed-off-by: awzhgw <guowl18702995996@gmail.com>
This commit is contained in:
parent
b376e01732
commit
669df1f3d7
@ -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
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user