Skip to content

Commit

Permalink
guest_c: print stats
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Dec 8, 2023
1 parent c1b93ed commit 9e8cfb0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions guest_c/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,18 @@ exports_wasi_sensor_interface_main()
wasi_buffer_pool_buffer_pool_list_frame_info_free(&frames);
}

wasi_buffer_pool_buffer_pool_pool_statistics_t stats;
if (!wasi_buffer_pool_buffer_pool_method_pool_get_statistics(
borrowed_pool, &stats, &buffer_error)) {
fprintf(stderr, "get-statistics failed (error %u)\n",
(unsigned int)buffer_error);
return false;
}
fprintf(stderr,
"stats: enqueued=%" PRIu64 " dequeued=%" PRIu64
" dropped=%" PRIu64 "\n",
stats.enqueued, stats.dequeued, stats.dropped);

fprintf(stderr, "cleaning up\n");
wasi_io_0_2_0_rc_2023_11_10_poll_pollable_drop_own(poll);
wasi_sensor_sensor_device_drop_own(device);
Expand Down

0 comments on commit 9e8cfb0

Please sign in to comment.