Power consumption of an iOS application - ios

I want check power usage of my iOS application.
I tried with the Instruments.
In the 'Energy Usage Level' it shows values 1/20 (0 to 20),indicating how much energy your app is using at any given time.
What the value meant 0 to 20?.
And how Can I export the value in to text document
Edit : How can I convert it to percentage of energy usage ?

What Apple mentioned is the following :
The Energy Usage instrument shows a level from 0 to 20, indicating how
much energy your app is using at a given time. These numbers are
subjective. If your app’s energy usage level is occasionally high, it
doesn’t necessarily mean that your app has a problem. Your app may
simply require more energy for some of the tasks it performs. For
example, it may use GPS while performing complex network operations.
This is valid energy use. What you should look for are spikes or areas
of high energy use that are unexpected or that could be performed at
more optimal times.
the numbers are subjective it just can be used as an indicator on how high your usage is, thats all.
the link also provides a way to log the energy usage level.

Related

% cpu, memory and network usage android application

Is there any Benchmark to compare cpu, memory and network usage with the one recorded by android profiler when using an application? or is there any best practice: e.g. cpu usage should be kept all the time less than 25%?
Thank you
There's no definitive benchmark. It all depends on your app. If it's a high fidelity game, hitting 100% CPU is not uncommon. But if it's just a simple calculator app, hitting above 10% CPU may be a bit too high. It's also device dependent so 50% on a Pixel 5 doesn't compare to 50% on a Nexus 5.
As an app developer, you should pay more attention to unexpected CPU usage spikes and investigate what's causing them. Similarly for memory usage, you should keep an eye out for memory usage spikes and memory leaks, as opposed to absolute values.
Network usage on the other hand is more about what's expected vs. what's actually being sent over the wires. Take a look at both the bandwidth and number of requests.

Foreground app activity over 100%?

I was just monitoring my iOS game's energy usage and I see that the foreground app activity often goes as high as 126%. I am just wondering if this is something I should be concerned about? The energy usage shows a constant value of 1/20--- yet the time column is always "00:00 - 00:00", so I am a little confused about what that means.
Also, is there a way to disable bluetooth, gps in my app since those features are unused? I assume they would contribute to some sort of energy usage. Instruments shows no information other than state is "on" with a time of "00:00".
Based on the Apple docs: https://developer.apple.com/library/content/documentation/Performance/Conceptual/EnergyGuide-iOS/MonitorEnergyWithInstruments.html
The Energy Usage instrument indicates a level from 0 to 20, indicating
how much energy your app is using at any given time. These numbers are
subjective. If your app’s energy usage level is occasionally high, it
doesn’t necessarily mean that your app has a problem. Your app may
simply require more energy for some of the tasks it performs. For
example, it may use the GPS while performing complex network
operations. This is valid energy use. What you should look for are
spikes or areas of high energy use that are unexpected or that could
be performed at more optimal times.
I don't think I'd sweat what you are seeing too much. What is your FPS? Are you maintaining a 60 fps? Your main time is spent on your foreground app, so if you're looking to thin it down you should looking at what your CPU is doing. You an look at Time Profiler if you want to see if you can improve performance there.
That being said, I think users do realize battery life will suffer if you're playing a game. However, that comment should be tempered with the type of game. If you're doing Tic Tac Toe and you're sucking the life out of a battery, I think you'll raise some brows.
You don't have means (which won't get you rejected) to forcibly turn off things. And even if you could you also could end up with angry users too. Say you're using a bluetooth headset ... and you kill bluetooth?
Just make sure your game is fun and people will forgive you ;)

Explain the statistics of Energy Usage Instrument in iOS

I am trying to find Energy Usage for my iOS App using Instrument.
I got the statistics like Time, Total Activity, Foreground App Activity, Audio Processing and
Graphics in Percentage format. The sum of Foreground App Activity, Audio Processing and
Graphics is different from Total Activity !
But I am not understanding what are the meaning of these columns? Can anybody please explain me the meaning of these statistics and how to use this?
Latest Energy Diagnostics documentation says:
The Energy Usage instrument shows a level from 0 to 20, indicating how
much energy your app is using at a given time. These numbers are
subjective. If your app’s energy usage level is occasionally high, it
doesn’t necessarily mean that your app has a problem. Your app may
simply require more energy for some of the tasks it performs. For
example, it may use GPS while performing complex network operations.
This is valid energy use. What you should look for are spikes or areas
of high energy use that are unexpected or that could be performed at
more optimal times.
yes, sure there is difference. The best way to use it; do one at a time. observe each Activity Consumption and target optimizing that.

Interpretation of results of "Energy Usage" instrument tool

I am running "energy usage" instrument over ios application using a device, I wanted to use it to check how much battery is getting drained because of the app I am testing. It shows "Energy usage level" which is giving me numbers like 13/20 , 12/20 , etc over different points of time.
How to interpret the results(I know, it gives relative energy usage on a scale of 0-20) in terms of :
1) How much battery is getting drained because of the app and particular operation.
2) Which operation / function is causing this drain.
3) What number is considered as safe and what number should be considered as high / too high.
4) Any other conclusion that we can make ?
I would appreciate if some one can answer above questions or give me link for reference. I have searched around and could not find answers to above questions, I just found how to find out those relative energy usage numbers only.
My 2 cents:
1) You can create a UIAutomation script to repeatedly run some actions, and collect 'energy usage' upon each action. So that you can say "if make a call of 5 minutes, it takes xxx battery", "if keep navigating for 5 minutes, it takes xxxx battery".....
2) As I mentioned above; You can collect data against each action
3) I would say, try to find similar apps, and bench mark, compare with theirs.
4) Try to use different devices, iOS, and you can probably tell customers that what device/iOS is minimal required or recommended.
Energy Diagnostics reports power consumption number (we call them "electricities" at my office) are fairly unreliable. Powergremlin gives you some insight into the actual numbers that make up said "electicity" units. That won't answer parts 2-4 of our question, but it does provide more detail and accuracy than Energy Diagnostics.
The scale of Batter Consumption of IOS App is given by max 20 points.
if your app is running at 1/20,it means your app takes 20 hours to complete the batter
if it is running at 20/20 it takes 1 hour to complete the full batter.

windows phone diagnostics logging

is it possible to get memory and CPU usage in windows phone (sdk 7.1) application?
what would be the best way to retrieve that data from the application for further analysis?
Try the Windows Phone Performance Analysis tool, it allows you to profile CPU usage, memory usage and record garbage collection:
If you're looking to analyze performance as well, take a look at the Frame Rate counters (these are enabled by default when you are debugging your app)
You'll want to keep your FPS high, and your screen fill rate low (anything above 3 or so is cause for deep concern, since it means your screen is being redrawn 3x for every frame; not the best thing for performance)
Jeff Wilcox has a good summary on this too which is worth reading.

Resources