Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

update required an optional parameters for getting performance #103

Merged
merged 2 commits into from
Feb 2, 2017

Conversation

KazuCocoa
Copy link
Member

@KazuCocoa KazuCocoa commented Jan 31, 2017

To get performance data via appium/java-client#562 , this driver should apply parameters packageName, dataType and dataReadTimeout , not applicationPackageName and performanceDataType, I think.

The following log is sending parameters with packageName, dataType and dataReadTimeout. If I sent parameters with applicationPackageName and performanceDataType, then Appium return {} as the result.

What do you think? @heeseon

[HTTP] --> POST /wd/hub/session/b3250db7-4d90-4e52-b0bb-989940cb08ae/appium/getPerformanceData {"packageName":"io.appium.android.apis","dataType":"cpuinfo","dataReadTimeout":1000}
[debug] [MJSONWP] Calling AppiumDriver.getPerformanceData() with args: ["io.appium.android.apis","cpuinfo",1000,null,null,"b3250db7-4d90-4e52-b0bb-989940cb08ae"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running 'adb' with args: ["-P",5037,"shell","dumpsys","cpuinfo","|","grep","'io.appium.android.apis'"]
[debug] [MJSONWP] Responding to client with driver.getPerformanceData() result: [["user","kernel"],["0","0"]]
[HTTP] <-- POST /wd/hub/session/b3250db7-4d90-4e52-b0bb-989940cb08ae/appium/getPerformanceData 200 140 ms - 101 
[HTTP] --> POST /wd/hub/session/b3250db7-4d90-4e52-b0bb-989940cb08ae/appium/getPerformanceData {"packageName":"io.appium.android.apis","dataType":"cpuinfo","dataReadTimeout":1000}
[debug] [MJSONWP] Calling AppiumDriver.getPerformanceData() with args: ["io.appium.android.apis","cpuinfo",1000,null,null,"b3250db7-4d90-4e52-b0bb-989940cb08ae"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running 'adb' with args: ["-P",5037,"shell","dumpsys","cpuinfo","|","grep","'io.appium.android.apis'"]
[debug] [MJSONWP] Responding to client with driver.getPerformanceData() result: [["user","kernel"],["0","0"]]
[HTTP] <-- POST /wd/hub/session/b3250db7-4d90-4e52-b0bb-989940cb08ae/appium/getPerformanceData 200 173 ms - 101 
[HTTP] --> POST /wd/hub/session/b3250db7-4d90-4e52-b0bb-989940cb08ae/appium/getPerformanceData {"packageName":"io.appium.android.apis","dataType":"batteryinfo","dataReadTimeout":1000}
[debug] [MJSONWP] Calling AppiumDriver.getPerformanceData() with args: ["io.appium.android.apis","batteryinfo",1000,null,null,"b3250db7-4d90-4e52-b0bb-989940cb08ae"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running 'adb' with args: ["-P",5037,"shell","dumpsys","battery","|","grep","'level'"]
[debug] [MJSONWP] Responding to client with driver.getPerformanceData() result: [["power"],["64"]]
[HTTP] <-- POST /wd/hub/session/b3250db7-4d90-4e52-b0bb-989940cb08ae/appium/getPerformanceData 200 106 ms - 90 
[HTTP] --> POST /wd/hub/session/b3250db7-4d90-4e52-b0bb-989940cb08ae/appium/getPerformanceData {"packageName":"io.appium.android.apis","dataType":"memoryinfo","dataReadTimeout":1000}
[debug] [MJSONWP] Calling AppiumDriver.getPerformanceData() with args: ["io.appium.android.apis","memoryinfo",1000,null,null,"b3250db7-4d90-4e52-b0bb-989940cb08ae"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running 'adb' with args: ["-P",5037,"shell","dumpsys","meminfo","'io.appium.android.apis'","|","grep","-E","'Native|Dalvik|EGL|GL|TOTAL'"]
[debug] [MJSONWP] Responding to client with driver.getPerformanceData() result: [["totalPrivateDirty","nativePrivateDirty","dalvikPrivateDirty","eglPrivateDirty","glPrivateDirty","totalPss","nativePss","dalvikPss","eglPss","glPss","nativeHeapAllocatedSize","nativeHeapSize"],["35564","3100","2632","27360",null,"37609","3107","2666","27360",null,"7168","1742"]]
[HTTP] <-- POST /wd/hub/session/b3250db7-4d90-4e52-b0bb-989940cb08ae/appium/getPerformanceData 200 392 ms - 353 

I also try to implement in ruby_lib

Copy link
Contributor

@imurchie imurchie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm for this. The unit test for protocol consistency needs to be updated though. https://github.com/appium/appium-base-driver/blob/master/test/mjsonwp/routes-specs.js#L41

@KazuCocoa
Copy link
Member Author

I updated the hash in 2484263

Copy link
Member

@jlipps jlipps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @KazuCocoa!

@jlipps
Copy link
Member

jlipps commented Feb 1, 2017

@imurchie technically this is a breaking change to the protocol. do you know of any other clients that would stop working because of this change? wanting to know what semver update to publish as.

@imurchie
Copy link
Contributor

imurchie commented Feb 2, 2017

@jlipps I'm not aware of any other clients actually implementing this.

@KazuCocoa
Copy link
Member Author

KazuCocoa commented Feb 2, 2017 via email

@jlipps
Copy link
Member

jlipps commented Feb 2, 2017

Well let's merge it then as soon as @imurchie approves!

@imurchie
Copy link
Contributor

imurchie commented Feb 2, 2017

Approved!

@jlipps jlipps merged commit 5e0730a into appium:master Feb 2, 2017
@jlipps
Copy link
Member

jlipps commented Feb 2, 2017

great, published as appium-base-driver@2.1.7

@KazuCocoa KazuCocoa deleted the fix_performance_params branch February 3, 2017 23:23
KazuCocoa pushed a commit to KazuCocoa/appium-base-driver that referenced this pull request Apr 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants