Skip to content

ASAPHub Performance Test

Marvin edited this page Sep 14, 2023 · 3 revisions

The ASAPExamplePerformanceTestActivity can be used to perform an end-to-end performance test between two ASAPAndroid peers connected through an ASAPHub.

prerequisites

Before the performance test can be started, the following prerequisites must be met:

  1. ASAPHub is running Ensure that the ASAPHub is running and accessible from both devices participating in the performance test. You can find instructions on how to start the hub in the ASAPHub Wiki.
  2. Peers are registered to the Hub Before the performance test can be initiated, both participating ASAPAndroid peers must register with the ASAPHub. To do this, click the "HubTester" button on the app's main screen. This will launch the ASAPExampleHubTesterActivity, which allows you to register the ASAPAndroid peer with the Hub using the HubConnectionManager.

Once these steps have been completed on both smartphones, the ASAPExamplePerformanceTestActivity can be started.

Start Performace Test

To start the performance test, select the "Hub Performance" button on the app's home screen. Here, the user can enter the number of bytes to be sent to the other peer. After the message has been received on the second smartphone, the performance test result will appear in the list.

screenshot_performance_test

How it works

When starting the HubPerformanceTestActivity, the smartphone's system time is synchronized with an NTP server. This is done to ensure that the system times of both smartphones participating in the performance test are as synchronized as possible. To initiate the performance test, Alice determines the message size for the test. Subsequently, a PerformanceTestPDU object is created. This object contains a ByteArray with the message size specified by Alice and the timestamp of when the message was sent.

Bob also has the HubPerformanceTestActivity open and waits for the test message to arrive. Once the PerformanceTestPDU from Alice reaches Bob, he compares the timestamp of the received PDU with the current system time on his side of the application. Therefore, it is essential that the system times of both devices are synchronized as closely as possible. The result is then displayed as a list on his smartphone.

enter image description here