File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,6 @@ import (
5656)
5757
5858var (
59- startTime time.Time
6059 updateGaugesPeriod = 5 * time .Second
6160 startCounter = metrics .NewRegisteredCounter ("stack,start" , nil )
6261 stopCounter = metrics .NewRegisteredCounter ("stack,stop" , nil )
@@ -80,6 +79,7 @@ type Swarm struct {
8079 swap * swap.Swap
8180 stateStore * state.DBStore
8281 accountingMetrics * protocols.AccountingMetrics
82+ startTime time.Time
8383
8484 tracerClose io.Closer
8585}
@@ -344,7 +344,7 @@ Start is called when the stack is started
344344*/
345345// implements the node.Service interface
346346func (self * Swarm ) Start (srv * p2p.Server ) error {
347- startTime = time .Now ()
347+ self . startTime = time .Now ()
348348
349349 self .tracerClose = tracing .Closer
350350
@@ -414,7 +414,7 @@ func (self *Swarm) periodicallyUpdateGauges() {
414414}
415415
416416func (self * Swarm ) updateGauges () {
417- uptimeGauge .Update (time .Since (startTime ).Nanoseconds ())
417+ uptimeGauge .Update (time .Since (self . startTime ).Nanoseconds ())
418418 requestsCacheGauge .Update (int64 (self .netStore .RequestsCacheLen ()))
419419}
420420
You can’t perform that action at this time.
0 commit comments