Closed Bug 927328 Opened 11 years ago Closed 11 years ago

[NetworkStats API] Make sure the app stats is updated when retrieving function (getSamples) is called

Categories

(Firefox OS Graveyard :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: johnshih.bugs, Assigned: johnshih.bugs)

References

Details

Attachments

(1 file, 1 obsolete file)

In NetworkStats API, apps stats is firstly saved in into caches and then updated into database in some situations: 1. when retrieving data function (getSample) is called 2. internal timer fired up 3. traffic amount saved in cached exceeds a threshold 4. system is shutting down and this bug is intended to fix the bug that the cached didn't update in situation 1.
Attachment #818190 - Flags: review?(gene.lian)
Comment on attachment 818190 [details] [diff] [review] Bug 927328 - Make sure app stats is udated when retrieving function is called. r=gene Review of attachment 818190 [details] [diff] [review]: ----------------------------------------------------------------- r=gene. Thanks! ::: dom/network/src/NetworkStatsService.jsm @@ +270,5 @@ > this.updateStats(netId, function onStatsUpdated(aResult, aMessage) { > debug("getstats for network " + network.id + " of type " + network.type); > debug("appId: " + appId + " from manifestURL: " + manifestURL); > > + this.updateCachedAppStats(function onAppStatsUpdated(aResult, aMessage) { Do you need to check the values of aResult and aMessage? Please carefully rebased this patch and test it again since the other one that Albert re-checked in is a bit different.
Attachment #818190 - Flags: review?(gene.lian) → review+
r=gene rebase the code for the change in bug 887699 and bug 923382.
Attachment #818190 - Attachment is obsolete: true
Attachment #824485 - Flags: review+
(In reply to Gene Lian [:gene] (needinfo? encouraged) from comment #2) > Comment on attachment 818190 [details] [diff] [review] > Bug 927328 - Make sure app stats is udated when retrieving function is > called. r=gene > > Review of attachment 818190 [details] [diff] [review]: > ----------------------------------------------------------------- > > r=gene. Thanks! > > ::: dom/network/src/NetworkStatsService.jsm > @@ +270,5 @@ > > this.updateStats(netId, function onStatsUpdated(aResult, aMessage) { > > debug("getstats for network " + network.id + " of type " + network.type); > > debug("appId: " + appId + " from manifestURL: " + manifestURL); > > > > + this.updateCachedAppStats(function onAppStatsUpdated(aResult, aMessage) { > > Do you need to check the values of aResult and aMessage? > The values of aResult and aMessage here have no affect on calling of _db.find. That is, no matter the update is success or not, it won't block the functionality of getSample(). As far as I know, these values are merely used in test cases now to make sure the queue is updated before it is accessed.
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: