Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Strange behavior on energy data #204

Open
wellington-oj opened this issue May 17, 2021 · 0 comments
Open

Strange behavior on energy data #204

wellington-oj opened this issue May 17, 2021 · 0 comments

Comments

@wellington-oj
Copy link

wellington-oj commented May 17, 2021

Hello.
I have been using battery historian (via adb shell dumpsys batterystats) while conducting some research on energy consumption. Recently I found some problems with some of the experiments.
While executing a fairly straight forward benchmark (https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/binarytrees.html) on a Ionic-developed app, the data about the energy consumption follows a strange pattern, that is, for some cases, the energy consumption goes down to almost zero. The factor that most impacts the energy consumption on these benchmarks is CPU and it seems like the time using the CPU is almost the same. The same happens for a number of other Ionic based apps and on our experiments. We did some experimentos on another framework (Flutter) and have similar results. Our experiments have been conducted in a Motorola G5. Other devices were used and presented the same phenomena.

Tests made while resetting the device before collecting the energy consumption data via adb shell dumpsys batterystats didn’t show this strange behavior. It seems to be an abnormal behavior present in only a selected group of apps.

Thank you.

I'll try to show what is happening with some data. This is the energy consumption of 10 executions of the Ionic application (data from "Estimated power use (mAh)" via adb shell dumpsys batterystats. For each subsequent execution after the first one, the battery was reset via adb shell dumpsys batterystats --reset):

  1. 5.61
  2. 0.0906
  3. 5.1
  4. 5.15
  5. 5.08
  6. 5.2
  7. 0.0944
  8. 5.19
  9. 5.56
  10. 6.41

As an example, that is the data from the first execution (with a consumption of 5.61 mAh):

u0a76:
Wake lock *launch* realtime
Wake lock WindowManager: 50s 451ms full (1 times) realtime
TOTAL wake: 50s 451ms full realtime
Foreground activities: 51s 888ms realtime (1 times)
Top for: 51s 889ms
Cached for: 91ms
Total running: 51s 980ms
Total cpu time: u=3m 27s 356ms s=14s 633ms
Proc com.android.chrome:sandboxed_process0:
CPU: 0ms usr + 0ms krn ; 0ms fg
1 starts
Proc io.ionic.starter:
CPU: 0ms usr + 0ms krn ; 0ms fg
1 starts
Apk com.android.chrome:
Service org.chromium.content.app.SandboxedProcessService0:
Created for: 0ms uptime
Starts: 0, launches: 1

and that is the data from the second execution (with a consumption of 0.0906mAh):

u0a76:
Wake lock *launch* realtime
Wake lock WindowManager: 42s 258ms full (1 times) realtime
TOTAL wake: 42s 258ms full realtime
Foreground activities: 43s 244ms realtime (1 times)
Top for: 43s 245ms
Cached for: 78ms
Total running: 43s 323ms
Total cpu time: u=2m 57s 330ms s=10s 813ms
Proc com.android.chrome:sandboxed_process0:
CPU: 0ms usr + 0ms krn ; 0ms fg
1 starts
Proc io.ionic.starter:
CPU: 0ms usr + 0ms krn ; 0ms fg
1 starts
Apk com.android.chrome:
Service org.chromium.content.app.SandboxedProcessService0:
Created for: 0ms uptime
Starts: 0, launches: 1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant