Closed
Bug 763524
Opened 13 years ago
Closed 13 years ago
give each saved ping its own file under a telemetry holding directory
Categories
(Toolkit :: Telemetry, defect)
Toolkit
Telemetry
Tracking
()
RESOLVED
FIXED
mozilla17
People
(Reporter: froydnj, Assigned: froydnj)
References
Details
Attachments
(3 files, 1 obsolete file)
2.25 KB,
patch
|
taras.mozilla
:
review+
|
Details | Diff | Splinter Review |
2.79 KB,
text/plain
|
taras.mozilla
:
review+
|
Details |
11.12 KB,
patch
|
taras.mozilla
:
review+
|
Details | Diff | Splinter Review |
No description provided.
![]() |
Assignee | |
Comment 1•13 years ago
|
||
Bug 753238 is adding some ASCII encoding stuff that would be mighty useful here, so waiting until that goes in.
![]() |
Assignee | |
Comment 2•13 years ago
|
||
Attachment #640591 -
Flags: review?(taras.mozilla)
![]() |
Assignee | |
Comment 3•13 years ago
|
||
Attachment #640592 -
Flags: review?(taras.mozilla)
![]() |
Assignee | |
Comment 4•13 years ago
|
||
I freely note here that we do lose the saved old-format ping in the sense that we no longer send it or read it in. I don't think it's worth keeping old code around and this is a small one-time loss of data, so I wasn't terribly concerned about it. But if you're concerned, let me know and I'll adjust.
Attachment #640595 -
Flags: review?(taras.mozilla)
Comment 5•13 years ago
|
||
(In reply to Nathan Froyd (:froydnj) from comment #4)
> Created attachment 640595 [details] [diff] [review]
> part 3 - save pings to unique files
>
> I freely note here that we do lose the saved old-format ping in the sense
> that we no longer send it or read it in. I don't think it's worth keeping
> old code around and this is a small one-time loss of data, so I wasn't
> terribly concerned about it. But if you're concerned, let me know and I'll
> adjust.
I'm not concerned. We should delete it, and do nothing else.
Comment 6•13 years ago
|
||
Comment on attachment 640591 [details] [diff] [review]
part 1 - pass entire ping to doPing
I like easy patches like this
Attachment #640591 -
Flags: review?(taras.mozilla) → review+
Comment 7•13 years ago
|
||
Comment on attachment 640592 [details]
part 2 - separate finishRequest out into its own function
+ if (file.exists()) {
+ file.remove(true);
+ }
Don't use this pattern. Just .remove() directly and deal with exceptions if any.
This almost doubles IO overhead with no gain.
Attachment #640592 -
Flags: review?(taras.mozilla) → review+
Comment 8•13 years ago
|
||
Comment on attachment 640595 [details] [diff] [review]
part 3 - save pings to unique files
addToPendingPings needs a comment describing what it does.
+ this._pendingPings.push(data);
+ this._pingLoadsCompleted++;
these also need documenting at declarations site
s/ensurePingDirectoryExists/ensurePingDirectory/
+ // Note that addToPendingPings relies on the callback(s) here from
+ // multiple calls to loadHistogram being called all on the same
+ // thread.
Code is less confusing without this comment
+ file.append(checksum);
Use uuid for filename to avoid redundant io.
r- because this patch is creating too many files
There should only ever be one pending ping to save which would overwrite previously saved ping.
Attachment #640595 -
Flags: review?(taras.mozilla) → review-
![]() |
Assignee | |
Comment 9•13 years ago
|
||
Attachment #640595 -
Attachment is obsolete: true
Attachment #641102 -
Flags: review?(taras.mozilla)
Comment 10•13 years ago
|
||
Comment on attachment 641102 [details] [diff] [review]
part 3 - save pings to unique files
+ verifyPingChecksum: function verifyPingChecksum(ping) {
+ if (!ping.checksum) {
+ return true;
+ }
+
+ let checksumNow = this.hashString(ping.payload);
+ return ping.checksum == checksumNow;
},
This needs a comment on why sometimes there is no checksum
Why would you have multiple pending pings? Is this just in preparation for future work?
Updated•13 years ago
|
Attachment #641102 -
Flags: review?(taras.mozilla)
![]() |
Assignee | |
Comment 11•13 years ago
|
||
(In reply to Taras Glek (:taras) from comment #10)
> Why would you have multiple pending pings? Is this just in preparation for
> future work?
It is unlikely that we'd have them now (the examples of unreachable metrics servers, either via downtime or lack of network connectivity, won't supply multiple pending pings until another bug is fixed), but an (contrived?) example goes something like:
- User starts Firefox;
- User shuts down Firefox in < 5 minutes, so the initial idle ping never gets sent;
- We therefore save statistics from that session;
- Repeat as often as you like; we continue to save pings at shutdown;
- User finally runs a session where the initial ping gets sent, and so sends off multiple pings from previous sessions.
I thought this was the sort of motivating example for doing this work, since telemetry suggested we have users starting and stopping Firefox in short bursts. The save-ping-to-prearranged-file approach we had would therefore lose data in such a scenario.
If you find such a scenario unconvincing, then yes, you can think of it as preparation for future work. But I don't understand why it's a problem now, since pendingPings has been an array to prepare for this sort of an eventuality for a while now.
Comment 12•13 years ago
|
||
Comment on attachment 641102 [details] [diff] [review]
part 3 - save pings to unique files
Thanks for the explanation.
Please comment verifyPingChecksum.
Attachment #641102 -
Flags: review+
![]() |
Assignee | |
Comment 13•13 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/9233c05bd8b0
https://hg.mozilla.org/integration/mozilla-inbound/rev/93b4fb5855a8
https://hg.mozilla.org/integration/mozilla-inbound/rev/b8e672f4fc77
Assignee: nobody → nfroyd
Status: NEW → ASSIGNED
Comment 14•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9233c05bd8b0
https://hg.mozilla.org/mozilla-central/rev/93b4fb5855a8
https://hg.mozilla.org/mozilla-central/rev/b8e672f4fc77
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
Comment 15•13 years ago
|
||
FYI this doesn't work. The directory is created mode 0600, which makes it inaccessible, so it can't write to it. I discovered this because my profile backups are complaining that they can't read it to back it up every night. The directory should be mode 0700.
You need to log in
before you can comment on or make changes to this bug.
Description
•