mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
storage: move watcherGauge to watchable_store
watcherGauge should be increased everytime we creates Watcher, not per watch method call.
This commit is contained in:
parent
319b77b051
commit
6e5eb03544
@ -165,6 +165,7 @@ func (s *watchableStore) Close() error {
|
||||
}
|
||||
|
||||
func (s *watchableStore) NewWatcher() Watcher {
|
||||
watcherGauge.Inc()
|
||||
return &watcher{
|
||||
watchable: s,
|
||||
ch: make(chan storagepb.Event, chanBufLen),
|
||||
|
@ -56,7 +56,6 @@ func (ws *watcher) Watch(key []byte, prefix bool, startRev int64) CancelFunc {
|
||||
}
|
||||
// TODO: cancelFunc needs to be removed from the cancels when it is called.
|
||||
ws.cancels = append(ws.cancels, c)
|
||||
watcherGauge.Inc()
|
||||
return c
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user