Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add emulation test plan #4

Merged
merged 55 commits into from
Nov 21, 2022
Merged

Conversation

ackintosh
Copy link
Member

@ackintosh ackintosh commented Jul 20, 2022

How to run

# Import test plans
git clone https://github.com/sigp/gossipsub-testground.git
testground plan import --from ./gossipsub-testground/

# Run `emulation` test plan
cd gossipsub-testground
testground run composition -f emulation/compositions/emulation.toml --wait

Test parameters available

READMEs

In this PR, the following READMEs have been updated/added.

What the emulation does

Note: Attackers connect to a single publisher (victim).

image

Dashboards

Please run docker-compose up and browse http://localhost:13000/dashboards.

Gossipsub Metrics

The metrics of gossipsub are recorded once the emulation has been completed. All of the metrics on libp2p-gossipsub are available in this dashboard.

Variables for this dashboard:

  • run_id: The run_id for the test run you want to see.
  • topic: The gossipsub topic, currently it's fixed to emulate.
  • instance_name: Some panels in this dashboard need an instance name to be specified. (e.g. score_per_mesh histogram)

image

Peer Scores

The peer scores are recorded periodically (every second) while the emulation is running.

Variables for this dashboard:

  • run_id: The run_id for the test run you want to see.
  • instance_name: It's default to All, you can select specific instances.

image


Remaining work

@ackintosh
Copy link
Member Author

Regarding recording gossipsub metrics: prometheus-client is used in libp2p-gossipsub, but in testground, InfluxDB. So in order to record gossipsub metrics (stored in prometheus-client) to InfluxDB, I need to progress Protobuf support on prometheus-client.

@ackintosh ackintosh force-pushed the test-plan-emulation branch from 1123108 to d37112c Compare August 31, 2022 07:42
@ackintosh ackintosh force-pushed the test-plan-emulation branch from d37112c to 92f4b8c Compare August 31, 2022 07:46
@ackintosh
Copy link
Member Author

ackintosh commented Sep 19, 2022

Trying to enable the protobuf feature on libp2p

I have updated libp2p on e46643a. The revision of libp2p 7eb216f4c259c8f5b6f23dbdc044b45e8a38c2e5 is in libp2p/rust-libp2p#2911.

The following compile error occurs now:

error[E0308]: mismatched types
   --> emulation/src/honest.rs:287:23
    |
287 |                 Some((registry, Config::default())),
    |                       ^^^^^^^^ expected trait `SendSyncEncodeMetric`, found trait `prometheus_client::encoding::proto::EncodeMetric`
    |
    = note: expected mutable reference `&mut prometheus_client::registry::Registry`
               found mutable reference `&mut prometheus_client::registry::Registry<Box<(dyn prometheus_client::encoding::proto::EncodeMetric + 'static)>>`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `emulation` due to previous error

I think something updates are needed on libp2p side, but I'm stuck. 🤔


UPDATE

I have updated libp2p on e46643a.
...
...
The following compile error occurs now:
...
I think something updates are needed on libp2p side, but I'm stuck. 🤔

I have reverted that on a1ac67a in order to progress create Grafana dashboard settings. Now the libp2p package points to my fork ( prometheus-ptotobuf-support branch), whose encoding is fixed to protobuf.


UPDATE: 2022-09-30

@ackintosh

This comment was marked as outdated.

* invalid_messages_per_topic
* accepted_messages_per_topic
* ignored_messages_per_topic
* rejected_messages_per_topic
* topic_iwant_msgs
This is helpful when we want to sort metrics by something not timestamp(e.g. instance_name).
Add Grafana container with preconfigured datasources and dashboards
Copy link
Member

@AgeManning AgeManning left a comment

Choose a reason for hiding this comment

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

This is solid progress. Lets merge down and make adjustments in future PRs

@AgeManning AgeManning merged commit cb2d84d into sigp:main Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants