Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Swap metrics reporter #1004

Closed
wants to merge 3 commits into from
Closed

Swap metrics reporter #1004

wants to merge 3 commits into from

Conversation

holisticode
Copy link
Contributor

This PR introduces metrics persistence to p2p accounting.

This PR is only for review and will be opened on the ethereum repo

@holisticode holisticode requested a review from nonsense November 16, 2018 19:43
@holisticode holisticode requested a review from zelig as a code owner November 16, 2018 19:43
@@ -179,6 +182,7 @@ func NewSwarm(config *api.Config, mockStore *mock.NodeStore) (self *Swarm, err e
return nil, err
}
self.swap = swap.New(balancesStore)
self.metricsStore = protocols.SetupAccountingMetrics(10*time.Second, filepath.Join(config.Path, "metrics.db"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think SetupAccountingMetrics is doing too many things - creating/loading the db into the registry and also firing up the reporter (currently set to every 10 seconds.). We should probably think about splitting this up, but it also works as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually NewAccountingMetrics that is doing both things, so I vote for keeping SetupAccountingMetrics as is

@holisticode
Copy link
Contributor Author

Closed by ethereum/go-ethereum#18136 which is the actual upstream PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants