storage: move watcherGauge to watchable_store

watcherGauge should be increased everytime we creates Watcher, not per watch
method call.
This commit is contained in:
Gyu-Ho Lee 2015-11-04 13:17:47 -08:00
parent 319b77b051
commit 6e5eb03544
2 changed files with 1 additions and 1 deletions

View File

@ -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),

View File

@ -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
}