Skip to content

Commit

Permalink
Merge pull request ethereum#455 from ethersphere/correct_log_line
Browse files Browse the repository at this point in the history
swarm/api: remove redundant log line
  • Loading branch information
zelig authored Apr 27, 2018
2 parents fc5deff + a9dbf15 commit 1e2b2f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions swarm/api/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,7 @@ func (s *Server) ServeHTTP(rw http.ResponseWriter, r *http.Request) {

req.uri = uri

log.Debug("parsed request path", "ruid", req.ruid, "method", req.Method, "uri", req.uri)
log.Debug("parsed request path", "uri.Addr", req.uri.Addr, "uri.path", req.uri.Path, "uri.Scheme", req.uri.Scheme)
log.Debug("parsed request path", "ruid", req.ruid, "method", req.Method, "uri.Addr", req.uri.Addr, "uri.Path", req.uri.Path, "uri.Scheme", req.uri.Scheme)

switch r.Method {
case "POST":
Expand Down
5 changes: 5 additions & 0 deletions swarm/storage/localstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ func (self *LocalStore) GetOrCreateRequest(key Key) (chunk *Chunk, created bool)
return chunk, true
}

// RequestsCacheLen returns the current number of outgoing requests stored in the cache
func (self *LocalStore) RequestsCacheLen() int {
return self.memStore.requests.Len()
}

// Close the local store
func (self *LocalStore) Close() {
self.DbStore.Close()
Expand Down
3 changes: 2 additions & 1 deletion swarm/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var (
startCounter = metrics.NewRegisteredCounter("stack,start", nil)
stopCounter = metrics.NewRegisteredCounter("stack,stop", nil)
uptimeGauge = metrics.NewRegisteredGauge("stack.uptime", nil)
cacheSizeGauge = metrics.NewRegisteredGauge("storage.db.cache.size", nil)
requestsCacheGauge = metrics.NewRegisteredGauge("storage.cache.requests.size", nil)
)

// the swarm stack
Expand Down Expand Up @@ -420,6 +420,7 @@ func (self *Swarm) periodicallyUpdateGauges() {

func (self *Swarm) updateGauges() {
uptimeGauge.Update(time.Since(startTime).Nanoseconds())
requestsCacheGauge.Update(int64(self.lstore.RequestsCacheLen()))
}

// implements the node.Service interface
Expand Down

0 comments on commit 1e2b2f8

Please sign in to comment.