migalabs / armiarma

Armiarma is a Libp2p open-network crawler with a current focus on Ethereum's CL network
https://monitoreth.io
MIT License
37 stars 13 forks source link

Refactor metrics module to be agnostic of data source #15

Closed alrevuelta closed 2 years ago

alrevuelta commented 3 years ago

Refactors the metrics module to be agnostic from the data source, so that its peer information can be fetched either from rumor in the case of armiarma-client or via gRPC calls for the armiarma-server. This module should define all structs related to the information that we want to store for each peer and its operations.

The goal is to make it a reusable module, that can be used by both the client and the server. This will allow to access both the aggregated metrics and single crawler metrics with the same interface. It's also important to decouple it from the rest of the code, making it also easier to unit test.

Work in progress:

cortze commented 3 years ago

Not sure if it was already in mind to implement a local database hosting the old PeerMetrics. we might be interested in adding a badger db which allows fast reading and writing, and key-value-version searches. What do you think?

alrevuelta commented 3 years ago

Thanks for the comments! One thing, were you checking the latest commit? I just see the diff between the first two ones. Perhaps you plan to review commit by commit?

Not sure if it was already in mind to implement a local database hosting the old PeerMetrics. we might be interested in adding a badger db which allows fast reading and writing, and key-value-version searches. What do you think?

Yep, thats an important feature. Let's move the discussions related to the db persistence to #18 since @kkhalil7 is working on that. I had in mind boltdb as its quite simple, also key-value and used by prysm software. However I don't have anything against badger-db.