refactor(perf): use libp2p-request-response

Rewrite `libp2p-perf` protocol using `libp2p-request-response`. Additionally adjust to latest conventions, e.g. the final JSON output.

Pull-Request: #3646.
This commit is contained in:
Max Inden
2023-05-28 07:51:53 +02:00
committed by GitHub
parent d4c4078e6d
commit 92af0d1281
11 changed files with 1103 additions and 498 deletions

View File

@@ -18,14 +18,11 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
use libp2p_perf::{
client::{self, RunParams},
server,
};
use libp2p_perf::{client, server, RunParams};
use libp2p_swarm::{Swarm, SwarmEvent};
use libp2p_swarm_test::SwarmExt;
#[async_std::test]
#[tokio::test]
async fn perf() {
let _ = env_logger::try_init();
@@ -36,7 +33,7 @@ async fn perf() {
server.listen().await;
client.connect(&mut server).await;
async_std::task::spawn(server.loop_on_next());
tokio::spawn(server.loop_on_next());
client
.behaviour_mut()