Closed sskorol closed 7 years ago
I added this. However, it's based on the app you're testing against. e.g. flick vitals -n com.package.com
. This will print out app cpu, app memory and system stats.
@isonic1 that's great!
But what about global memory / CPU stats? App may crash due to low device resources, and it'd be useful to see the root cause in logs. Does it make sense to you?
P.S. vitals
doesn't accept udid
at moment. Could you please add this option?
It includes both the app memory/cpu usage and total system/global memory/cpu. If app crashes, it will just return to you global system stats. Whoops. let me add the udid.
On Sun, Jan 29, 2017 at 2:46 PM, Sergey Korol notifications@github.com wrote:
@isonic1 https://github.com/isonic1 that's great!
But what about global memory / CPU stats? App may crash due to low resources, and it'd be useful to see the root cause in logs. Does it make sense to you?
P.S. vitals doesn't accept udid at moment. Could you please add this option?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/isonic1/flick/issues/19#issuecomment-275940530, or mute the thread https://github.com/notifications/unsubscribe-auth/ABXXr8WpuC40YjaGvZ0p5bQTXtu5W0Etks5rXOyUgaJpZM4LwvHV .
New gem is published. Includes the UDID argument now. Thanks for noticing that.
@isonic1 just checked, works good, thanks!
As an improvement, would be great to add some user-friendly output, as plenty of : => {}
characters is a bit painful for parsing into model. Personally I use flick
in a java microservice, and parse cmd output for further sending to remote clients.
Oh, it should return JSON. So if you assign the output to variable. e.g. perf = flick vitals -p android -n com.myawesomeapp.com
it will give you a hash. Might come back as a string. If so, you should be able to convert it to JSON. After, you should then do something like perf[:app_stats][:memory]
or however you get your JSON objects in Java. Does this not work?
Not sure if this helps at all. Looks like in Java it's harder to do than other languages. For instance, in Ruby I could just do eval(perf)
around the string to turn it back into a hash.
http://stackoverflow.com/questions/26485964/how-to-convert-string-into-hashmap-in-java
@isonic1 sorry, missed your last comment.
vitals
command returns the following:
{:app_stats=>{:memory_mb=>0.0, :cpu_per=>0}, :system_stats=>{:user=>0, :system=>2, :iow=>0, :irq=>0}}
It's not a valid json format, and it can't be converted to json as well (without additional pre-processing).
@isonic1 hi,
Would be great, if
flick
could retrieve CPU / memory usage info from plugged devices. Someadb
examples: