Add disk size measurements for places.sqlite and favicons.sqlite
Categories
(Firefox :: Profile Backup, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox126 | --- | fixed |
People
(Reporter: mconley, Assigned: kpatenio)
References
Details
(Whiteboard: [fidefe-device-migration])
Attachments
(2 files, 2 obsolete files)
Bug 1883642 - Add disk size measurements for places.sqlite and favicons.sqlite. r=#backup-reviewers!
48 bytes,
text/x-phabricator-request
|
Details | Review | |
3.29 KB,
text/plain
|
jhirsch
:
data-review+
|
Details |
Within BackupService, on initialization, we'll want to use IOUtils.stat
to get the file size of places.sqlite and favicons.sqlite in the profile directory.
We'll want to add these as Glean scalar probes. This will be the first set to land, so we'll need to do the following:
- Add a
metrics.yaml
tobrowser/components/backup
. Themigration
probes can be used as a general template. - Add a namespace -
browser.backup
, and two probes within it - one forplaces_size
and one forfavicons_size
. These should be of typequantity
: https://mozilla.github.io/glean/book/reference/metrics/quantity.html - Add a new async private method within the
BackupService
class for collecting measurements, and call that from the constructor. - Have the private method use
IOUtils.stat
to get the file size ofplaces.sqlite
andfavicons.sqlite
. Thestat
Promise will resolve with the file size in bytes, or -1 if the file size can't be read. If it's-1
, just record it as0
. Otherwise, round it to the nearest size in kilobytes, and record that. - Add a new directory called
tests
underbrowser/components/backup
and create axpcshell
folder in there. Within that, place axpcshell.toml
file in there that has these two lines - After running
./mach build
, add a new test, using./mach addtest browser/components/backup/test/xpcshell/test_resource_measurements.js
- Inside that xpcshell test, use an
add_setup()
, and calldo_get_profile
andServices.fog.initializeFOG()
, like this: https://searchfox.org/mozilla-central/rev/172e503b01303c153b0dfe39827acb2bc9ede1b9/browser/components/newtab/test/xpcshell/test_TelemetryFeed.js#105-107 - Import
BackupService
, and then write a test usingadd_task
that constructs a newBackupService
instance, and then tests that the two probes have values > 0, kinda like this: https://searchfox.org/mozilla-central/rev/172e503b01303c153b0dfe39827acb2bc9ede1b9/toolkit/components/glean/tests/xpcshell/test_Glean.js#76
It's possible that do_get_profile
won't actually do the work to create a Places and/or Favicons database, and the sizes of the files in the test will be 0
. If so, there are probably some small tweaks we can make to add_setup
to ensure that those databases exist.
Updated•9 months ago
|
Reporter | ||
Comment 1•9 months ago
|
||
And of course, don't forget to create the data review request. Maybe do that after (2) so that you can work on 3-8 while the data review is underway. Don't forget about ./mach data-review
!
Comment 2•8 months ago
|
||
Adds a BackupResource
abstract class to be extended by more specific resource handlers and a BackupResources
module to import them into.
All imported resources will be provided to the BackupService
constructor to instanciate.
Updated•8 months ago
|
Comment 3•8 months ago
|
||
Comment on attachment 9390308 [details]
Bug 1883642 - Add BackupResource abstract class. r=mconley,kpatenio
Revision D203795 was moved to bug 1884995. Setting attachment 9390308 [details] to obsolete.
Need info'ing myself as a personal reminder for data review
Comment 9•8 months ago
|
||
Comment on attachment 9391133 [details]
Data collection request
data-review+
Just a suggestion--while this technically falls under category 1 data, I'd encourage introducing some level of fuzzing to reduce the potential for user fingerprinting, using either a histogram to bucket the data at some finer-grained level than MB, but not providing full data visibility down to the individual kilobyte; or rounding the data off to some acceptable error level, as was done in bug 1884407.
- Is there or will there be documentation that describes the schema for the ultimate data set in a public, complete, and accurate way?
Yes, the usual Glean data dictionary.
- Is there a control mechanism that allows the user to turn the data collection on and off?
Yes, the usual Firefox data submission opt-out controls.
- If the request is for permanent data collection, is there someone who will monitor the data over time?
Yes, mconley will monitor.
- Using the category system of data types on the Mozilla wiki, what collection type of data do the requested measurements fall under?
Category 1, technical data.
- Is the data collection request for default-on or default-off?
Default-on.
- Does the instrumentation include the addition of any new identifiers (whether anonymous or otherwise; e.g., username, random IDs, etc. See the appendix for more details)?
No.
- Is the data collection covered by the existing Firefox privacy notice?
Yes.
- Does the data collection use a third-party collection tool?
No.
Comment 10•8 months ago
|
||
Comment 11•8 months ago
|
||
bugherder |
Description
•