Closed
Bug 844774
Opened 13 years ago
Closed 13 years ago
NetworkStatistics API needs a consistent way to manage data after a clock change
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(blocking-b2g:tef+, firefox20 wontfix, firefox21 wontfix, firefox22 fixed, b2g18+ fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 fixed)
People
(Reporter: salva, Assigned: albert)
References
Details
(Whiteboard: QARegressExclude)
Attachments
(1 file)
|
3.00 KB,
patch
|
khuey
:
review+
baku
:
feedback+
|
Details | Diff | Splinter Review |
We need a well defined behaviour when updating network statistics database after a clock change. After a clock change, no data should be lost but database must keep itself consistent. The sequence of samples timestamps must keep growing despite clocks changes to past.
Comment 1•13 years ago
|
||
Adding an observer for "system-clock-change" might help.
| Reporter | ||
Comment 2•13 years ago
|
||
Undoubtedly, can you paste a URL with the documentation or details, please?
Flags: needinfo?(gene.lian)
Comment 3•13 years ago
|
||
Please trace the |kSysClockChangeObserverTopic| in dom/system/gonk/RadioInterfaceLayer.js, which can help you know the dynamic change of system clock time. Adding an observer for it and then you can update your DB records whenever a time change is encountered.
Flags: needinfo?(gene.lian)
| Reporter | ||
Comment 4•13 years ago
|
||
After thinking about this and having an offline discussion beetwen Albert and me, we can adress the problem in two ways:
One is as follows: if new data have happened before the last recorded sample (i.e. the user changed the clock back so the new information is in the past) then store it in the **last sample**.
The other one is to listen for `kSysClockChangeObserverTopic` in order to know when the clock has changed and rebuild the timeline storing the values with an accurate timestamp independent on user changes.
Although we need a more formal defintion about databse consistency we can say one the requirement is the all data should be indexed as a monotonic growing serie. Both solutions meet this requirement but the second one keeps more information as it is able to store new usage in the moment it really happened while the first one is not able to exactly determine when new usage happened so it uses always the last sample instead.
Having in mind the current implementation of the gaia client we will have the following problems with the second approach:
- Client must track stats for different SIMs because it is not yet implemented in Gecko, and without the knowledge of the stored timestamp it won't be able to do it properly.
- Suppose you set the billing period (this is a front-end only concept) from day 1 to day 7, At the day 3, you change the clock 24 hours before (from day 3 to day 2). When asking from period 1 - 7. What should it be returned? Data for days 1 to 7? For days 2 to 8? Queries can only refer user / system clock as the client is not aware about changes in the system clock.
To summarize, for simplicity we prefer to implement the first option despite we know it loose some information (about when the data usage exactly happened). And also a better solution will imply big changes for Gecko and Gaia parts that we supose will not be accepted now.
| Assignee | ||
Comment 5•13 years ago
|
||
Attachment #721114 -
Flags: review?(amarchesini)
Comment 6•13 years ago
|
||
Comment on attachment 721114 [details] [diff] [review]
Merge new sample with last one when clock has changed back
Review of attachment 721114 [details] [diff] [review]:
-----------------------------------------------------------------
It looks good. But I'm not a reviewer for this component. Kyle, can you take a look?
Attachment #721114 -
Flags: review?(khuey)
Attachment #721114 -
Flags: review?(amarchesini)
Attachment #721114 -
Flags: feedback+
Attachment #721114 -
Flags: review?(khuey) → review+
| Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Comment 7•13 years ago
|
||
Keywords: checkin-needed
Comment 8•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → B2G C4 (2jan on)
Updated•13 years ago
|
status-b2g18:
--- → affected
Comment 9•13 years ago
|
||
status-b2g18-v1.0.0:
--- → wontfix
status-b2g18-v1.0.1:
--- → wontfix
status-firefox20:
--- → wontfix
status-firefox21:
--- → wontfix
status-firefox22:
--- → fixed
| Reporter | ||
Comment 10•13 years ago
|
||
This patch is no in v1.0.1 as you can see in the flags but it is causing bug 846402 which in nominated tef+, so renominating.
Comment 11•13 years ago
|
||
Marking v1.0.1 as affected and tef+ as this is required to fix bug 846402
Status: REOPENED → RESOLVED
blocking-b2g: tef? → tef+
Closed: 13 years ago → 13 years ago
Resolution: --- → FIXED
Comment 13•13 years ago
|
||
mmm
should we live this bug as resolved fixed, ask for a tef? (cause is blocking an already tef+) and mark status-b2g18-v1.0.1 as affected, for better understanding?
:)
Comment 14•13 years ago
|
||
(In reply to Francisco Jordano [:arcturus] from comment #13)
> mmm
>
> should we live this bug as resolved fixed, ask for a tef? (cause is blocking
> an already tef+) and mark status-b2g18-v1.0.1 as affected, for better
> understanding?
>
> :)
Sorry, forget my previous comment, Daniel already did this 24 seconds ago.
Thanks!
Comment 15•13 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•