aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer_sync.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-01-10 01:00:11 -0800
committerchrislu <chris.lu@gmail.com>2022-01-10 01:00:11 -0800
commit6a12520a960f2f19843c47135f2c915da7472c26 (patch)
treee52e0087ebce12e25dc020f6cec1ad87558e7354 /weed/command/filer_sync.go
parentcbc055dc2b1cfdea16ae557780a9476b566899fe (diff)
downloadseaweedfs-6a12520a960f2f19843c47135f2c915da7472c26.tar.xz
seaweedfs-6a12520a960f2f19843c47135f2c915da7472c26.zip
fix logging
Diffstat (limited to 'weed/command/filer_sync.go')
-rw-r--r--weed/command/filer_sync.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.go
index 326bd1fbe..172be6a9a 100644
--- a/weed/command/filer_sync.go
+++ b/weed/command/filer_sync.go
@@ -169,8 +169,11 @@ func doSubscribeFilerMetaChanges(clientId int32, grpcDialOption grpc.DialOption,
return persistEventFn(resp)
}
+ var lastLogTsNs = time.Now().Nanosecond()
processEventFnWithOffset := pb.AddOffsetFunc(processEventFn, 3*time.Second, func(counter int64, lastTsNs int64) error {
- glog.V(0).Infof("sync %s to %s progressed to %v %0.2f/sec", sourceFiler, targetFiler, time.Unix(0, lastTsNs), float64(counter)/float64(3))
+ now := time.Now().Nanosecond()
+ glog.V(0).Infof("sync %s to %s progressed to %v %0.2f/sec", sourceFiler, targetFiler, time.Unix(0, lastTsNs), float64(counter)/(float64(now-lastLogTsNs)/1e9))
+ lastLogTsNs = now
return setOffset(grpcDialOption, targetFiler, SyncKeyPrefix, sourceFilerSignature, lastTsNs)
})