Closed Bug 854206 Opened 7 years ago Closed 2 years ago

[Per app power metering] - Calculate Wifi component usage per process

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: vchang, Assigned: bochen)

References

(Depends on 1 open bug)

Details

Attachments

(2 files, 5 obsolete files)

No description provided.
Blocks: 854200
One of the key issue is how to know which app is using Wi-Fi. 

To my knowledge, Android uses Wifilock to know which app is using Wi-Fi. Acquiring a wifilock can keep Wi-Fi awake until the lock is released. Making use of this mechanism, Android can know which app is acquiring Wi-Fi. Then, using timer to measure the Wi-Fi running time.
Once we can have network statistic for wifi interface, we can calculate the power consumption for wifi component by using tx/rx packets, connection rate and average power consumption for wifi component.
Depends on: 784575
No longer depends on: 784575
Blocks: 784575
Attached patch bug_854206.patch (obsolete) — Splinter Review
This patch implements in NetworkStatsService to notify PowerStatsService some information. The formation is manifestURL, txBytes + rxBytes and wifi link speed.
Attached patch Part0: get info from Network (obsolete) — Splinter Review
This patch implements in NetworkStatsService to notify PowerStatsService some information. The formation is manifestURL, txBytes + rxBytes and wifi link speed.
This patch depends on Bug 784575.
Attachment #787934 - Attachment is obsolete: true
Attachment #787944 - Attachment is obsolete: true
After getting the information from NetworkStatsService. PowerStatsService estimates power consumption of wifi transmission.
Attachment #787968 - Flags: review?(vchang)
Fix bugs.
Attachment #787945 - Attachment is obsolete: true
No longer blocks: 784575, 854200
Depends on: 784575, 854200
Comment on attachment 787968 [details] [diff] [review]
Part1: estimate power consumption of wifi transmission

Review of attachment 787968 [details] [diff] [review]:
-----------------------------------------------------------------

Please fix some nits.

::: dom/power/PowerStatsService.jsm
@@ +37,5 @@
>  
> +XPCOMUtils.defineLazyServiceGetter(this, "networkstatsService",
> +                                   "@mozilla.org/networkstatsService;1",
> +                                   "nsINetworkStatsService");
> +

This seems not used in this patch. Please remove it.

@@ +313,5 @@
>      if (item == "pid") {
>        appPowerInfo[index].pid = value[0];
>      }
>  
> +    if (item === "wifiactive") {

value is a array right ? Please add the comment to explain the format of value.
Attachment #787968 - Flags: review?(vchang)
Assignee: nobody → glai
Assignee: glai → gavin09
Attachment #787968 - Attachment is obsolete: true
Attachment #788001 - Attachment is obsolete: true
Depends on: 899596
Assignee: gavin09 → bochen
Depends on: 902764
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.