Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support non-battery metrics #18

Open
cameocoder opened this issue Dec 14, 2017 · 7 comments
Open

Support non-battery metrics #18

cameocoder opened this issue Dec 14, 2017 · 7 comments

Comments

@cameocoder
Copy link

Finding this library useful. It would be nice to be able to monitor some other non-battery, or perhaps tangentially related to battery metrics:

  • Memory usage
  • Number of threads
@kunalb
Copy link
Contributor

kunalb commented Dec 14, 2017

Heh, thanks! We'd been discussing adding memory usage internally, number of threads also makes a lot of sense.

@HughIngram
Copy link

I'd be very interested in this too. I'm working on an app which has a persistent foreground service that is often killed onTrimMemory, so tracking memory usage would be very useful to us.

What would also be really useful is tracking usages of the LocationManager / FusedLocation API's, as well as the accelerators and gyroscopes. It's currently very hard for us to tell how much battery usage is caused by usage of these sensors.

@kunalb
Copy link
Contributor

kunalb commented Feb 23, 2018

@HughIngram, @cameocoder what kind of collection would expect a memory collector to maintain: automatically reading memory values at regular intervals and maintaining a histogram or just current values whenever called (which would basically just be a wrapper around https://developer.android.com/reference/android/os/Debug.MemoryInfo.html)? I'm curious because memory would be a bit different from cpu/network use.

We have a currently not super reliable collector for location that I'll be cleaning up and releasing within a month or so; but you still have to hook things up by hand =/.

Outside of healthstats (that's coming sooner than location!) I don't know of any way to access sensor usage: or model the cost at the moment. Would you have any pointers to that information?

@HughIngram
Copy link

@kunalb thanks for the response. I'll get back to you when I've got a better understanding of what we actually want in our project.

@cameocoder
Copy link
Author

At this time I don't think we need detailed memory info. Just a current value for app memory usage is what I would look for.

We currently have automation that just does a 'ps' or 'top' between tests to log app memory usage and number of threads to see if they increase.

@kunalb
Copy link
Contributor

kunalb commented Mar 6, 2018

Ah, that makes sense: I was thinking about it some more and I think that makes the most sense – have basic base metrics collectors that return current values, and at some point in the future we can write something that takes snapshots automatically at a given interval and uses them.

@kunalb
Copy link
Contributor

kunalb commented Mar 6, 2018

@cameocoder Till I can get something done here (which will take some time)– or if you have some time to implement this for battery metrics, you might find it valuable to use https://developer.android.com/reference/android/os/Debug.html#getMemoryInfo(android.os.Debug.MemoryInfo) which is what the library would end up using anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants