File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
tests/integration_tests/performance Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 2
2
# SPDX-License-Identifier: Apache-2.0
3
3
"""Tests the network latency of a Firecracker guest."""
4
4
5
+ import json
5
6
import re
7
+ from pathlib import Path
6
8
7
9
import pytest
8
10
@@ -95,6 +97,7 @@ def test_network_tcp_throughput(
95
97
payload_length ,
96
98
mode ,
97
99
metrics ,
100
+ test_output_dir ,
98
101
):
99
102
"""
100
103
Iperf between guest and host in both directions for TCP workload.
@@ -133,4 +136,16 @@ def test_network_tcp_throughput(
133
136
)
134
137
data = test .run_test (network_microvm .vcpus_count + 2 )
135
138
139
+ cpu_load_path = Path (test_output_dir / "cpu_load.json" )
140
+ with open (cpu_load_path , "w" , encoding = "utf-8" ) as f :
141
+ json .dump (data ["cpu_load_raw" ], f )
142
+ for i , g2h in enumerate (data ["g2h" ]):
143
+ path = Path (test_output_dir / f"g2h_{ i } .json" )
144
+ with open (path , "w" , encoding = "utf-8" ) as f :
145
+ json .dump (g2h , f )
146
+ for i , h2g in enumerate (data ["h2g" ]):
147
+ path = Path (test_output_dir / f"h2g_{ i } .json" )
148
+ with open (path , "w" , encoding = "utf-8" ) as f :
149
+ json .dump (h2g , f )
150
+
136
151
emit_iperf3_metrics (metrics , data , warmup_sec )
You can’t perform that action at this time.
0 commit comments