add apis to read the performance data#562
add apis to read the performance data#562SrinivasanTarget merged 9 commits intoappium:masterappium/java-client:masterfrom heeseon:readperformancedataheeseon/java-client:readperformancedataCopy head branch name to clipboard
Conversation
|
|
||
| List<String> supportedPerformanceDataTypes = driver.getSupportedPerformanceDataTypes(); | ||
|
|
||
| for(int i = 0 ; i < supportedPerformanceDataTypes.size() ; ++ i){ |
There was a problem hiding this comment.
why not to use for .. in here?
There was a problem hiding this comment.
i applied it.
but I think there is no reason to check the value of the table, because the values could be changed in appium-android-driver.
I have a plan to add some other values for example, heaphistogram....
|
|
||
| int valueTableHeadLength = valueTable.get(0).size(); | ||
|
|
||
| for(int j = 1 ; j < valueTable.size() ; ++ j){ |
There was a problem hiding this comment.
same here. Use subList property to get a slice
There was a problem hiding this comment.
I am not sure about the difference between List.get(i) and List.subList(i,i).
but I applied it.
and one more,
in case of this method,
there is no reason to check the head value of the returned table, because the implementation is dependent for the platform that means the head value could be changed.
| driver.startActivity("io.appium.android.apis", ".ApiDemos"); | ||
|
|
||
| List<String> supportedPerformanceDataTypes = driver.getSupportedPerformanceDataTypes(); | ||
| assert(supportedPerformanceDataTypes.size() == 4); |
There was a problem hiding this comment.
it could be more readable to use assertEquals instead
| import org.openqa.selenium.internal.HasIdentity; | ||
|
|
||
| import java.util.AbstractMap; | ||
| import java.util.List; |
| assertNotEquals(0, driver.getSystemBars().size()); | ||
| } | ||
|
|
||
| @Test public void getSupportedPerformanceDataTypesTest() { |
There was a problem hiding this comment.
ok I used assertEquals
There was a problem hiding this comment.
@heeseon
It looks ok but I would like to make the same the following way
public interface HasSupportedPerformanceDataType extends ExecutesMethod {
default List<String> getSupportedPerformanceDataTypes() {
return CommandExecutionHelper.execute(this, getSupportedPerformanceDataTypesCommand());
}
default List<List<Object>> getPerformanceData(String packageName, String dataType, int dataReadTimeout) {
return CommandExecutionHelper.execute(this,
getPerformanceDataCommand(packageName, dataType, dataReadTimeout));
}
}and then you just need to declare
public class AndroidDriver<T extends WebElement>
extends AppiumDriver<T>
implements PressesKeyCode, HasNetworkConnection, PushesFiles, StartsActivity,
FindsByAndroidUIAutomator<T>, LocksAndroidDevice, HasSettings, HasDeviceDetails, HasSupportedPerformanceDataType {
...
}|
fixed all |
| super(substituteMobilePlatform(desiredCapabilities, ANDROID_PLATFORM)); | ||
| } | ||
|
|
||
| /** |
There was a problem hiding this comment.
Hi @heeseon
Everything is ok but... could you remove the code below and move java doc to the HasSupportedPerformanceDataType? It is not necessary to duplicate code of API implemented by default. I think there is no specific details of the AndroidDriver behaviour.
|
I deleted the duplicated code. Please check it. |
|
|
||
| /** | ||
| * Created by hwangheeseon on 2017. 2. 2.. | ||
| */ |
|
Ok |
|
I have approved these changes. @SrinivasanTarget ? |
|
Thanks @heeseon |
Change list
add apis to read the resource usage information of the application as like cpu, memory, network traffic, and battery
Types of changes
What types of changes are you proposing/introducing to Java client?
Put an
xin the boxes that applyDetails
The appium already has a way to gather the performance data by log.
but If the resulting data format is set to a log file, the user should conduct another parsing to show the data on the screen.
also I think user wants to decide the moment to read the data and associate the performance data and other information.
so I’d like to add apis to gather the performance data.
please refer below the commit code