feat(filer.sync): add metricsServer in filer.sync.

Metrics include:
(1) the offset of the filer.sync
(2) the last send timestamp of the filer subscription
This commit is contained in:
zhihao.qu
2022-06-15 11:33:18 +08:00
parent d4ef06cdcf
commit 42d04c581b
3 changed files with 32 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package weed_server
import (
"fmt"
"github.com/chrislusf/seaweedfs/weed/stats"
"strings"
"time"
@@ -229,6 +230,9 @@ func (fs *FilerServer) eachEventNotificationFn(req *filer_pb.SubscribeMetadataRe
}
}
// collect timestamps for path
stats.FilerServerLastSendTsOfSubscribeGauge.WithLabelValues(fs.option.Host.String(), req.ClientName, req.PathPrefix).Set(float64(tsNs))
message := &filer_pb.SubscribeMetadataResponse{
Directory: dirPath,
EventNotification: eventNotification,