Skip to content

Commit

Permalink
tests/multi_bluetooth: Use multitest.output_metric in BLE perf tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Mar 23, 2023
1 parent af42634 commit 6c76248
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/multi_bluetooth/perf_gatt_char_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def instance1():
ticks_end = time.ticks_ms()
ticks_total = time.ticks_diff(ticks_end, ticks_start)

print(
multitest.output_metric(
"Did {} writes in {} ms. {} ms/write, {} bytes/sec".format(
_NUM_NOTIFICATIONS,
ticks_total,
Expand Down
2 changes: 1 addition & 1 deletion tests/multi_bluetooth/perf_gatt_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def instance0():

ticks_end = time.ticks_ms()
ticks_total = time.ticks_diff(ticks_end, ticks_start)
print(
multitest.output_metric(
"Acknowledged {} notifications in {} ms. {} ms/notification.".format(
_NUM_NOTIFICATIONS, ticks_total, ticks_total // _NUM_NOTIFICATIONS
)
Expand Down
5 changes: 5 additions & 0 deletions tests/multi_bluetooth/perf_gatt_notify.py.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--- instance0 ---
gap_advertise
gap_disconnect: True
--- instance1 ---
gap_connect
2 changes: 1 addition & 1 deletion tests/multi_bluetooth/perf_l2cap.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def instance1():
ble.l2cap_disconnect(conn_handle, cid)
wait_for_event(_IRQ_L2CAP_DISCONNECT, TIMEOUT_MS)

print(
multitest.output_metric(
"Received {}/{} bytes in {} ms. {} B/s".format(
recv_bytes, recv_correct, total_ticks, recv_bytes * 1000 // total_ticks
)
Expand Down
4 changes: 4 additions & 0 deletions tests/multi_bluetooth/perf_l2cap.py.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--- instance0 ---

--- instance1 ---

0 comments on commit 6c76248

Please sign in to comment.