Closed
Bug 1009315
Opened 10 years ago
Closed 10 years ago
Replace TelemetryContract interfaces with enums
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 32
People
(Reporter: mcomella, Assigned: mcomella)
References
Details
Attachments
(4 files, 6 obsolete files)
4.65 KB,
patch
|
liuche
:
review+
|
Details | Diff | Splinter Review |
4.55 KB,
patch
|
liuche
:
review+
|
Details | Diff | Splinter Review |
20.69 KB,
patch
|
liuche
:
review+
|
Details | Diff | Splinter Review |
13.35 KB,
patch
|
mcomella
:
review+
|
Details | Diff | Splinter Review |
This allows type-checking for Telemetry.* methods (e.g. `Telemetry.sendUIEvent(Event, Method, ...)`).
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → michael.l.comella
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•10 years ago
|
||
Finkle recommended doing this while I was committing to all of this churn anyway.
Attachment #8423329 -
Flags: review?(liuche)
Assignee | ||
Updated•10 years ago
|
Attachment #8423329 -
Attachment is obsolete: true
Attachment #8423329 -
Flags: review?(liuche)
Updated•10 years ago
|
Attachment #8423327 -
Flags: review?(liuche) → review+
Assignee | ||
Comment 4•10 years ago
|
||
Test fixes in part 4.
Attachment #8423441 -
Flags: review?(liuche)
Updated•10 years ago
|
Attachment #8423331 -
Flags: review?(liuche) → review+
Assignee | ||
Comment 5•10 years ago
|
||
re part 3: I should note that accomodating for `":" + String` over the Enum makes the Telemetry API a bit more messy, but I couldn't come up with another solution. One possible thought is to create Wrapper Objects that take the enum instance and the suffix String and pass this to the Telemetry methods, but the extra allocation is undesirable. One way around this is to create an Object pool, but at that point, I think it's much too overengineered.
Comment 6•10 years ago
|
||
Comment on attachment 8423327 [details] [diff] [review] Part 1: Sort TelemetryContract items. Actually rnewman already landed this in bug 917480, part 5.
Attachment #8423327 -
Attachment is obsolete: true
Comment 7•10 years ago
|
||
Comment on attachment 8423327 [details] [diff] [review] Part 1: Sort TelemetryContract items. Er, part of this patch, anyways.
Attachment #8423327 -
Attachment is obsolete: false
Assignee | ||
Comment 8•10 years ago
|
||
(In reply to Chenxia Liu [:liuche] from comment #6) > Actually rnewman already landed this in bug 917480, part 5. He landed the churn for Event - I did the others. I consider it inspiration. :)
Assignee | ||
Comment 9•10 years ago
|
||
I spent more time fixing this than I would like so it's a bit hacky - feel free to send me back to make this more robust. try: https://tbpl.mozilla.org/?tree=Try&rev=11461f595832
Attachment #8423502 -
Flags: review?(liuche)
Comment 10•10 years ago
|
||
Comment on attachment 8423441 [details] [diff] [review] Part 3: Replace TelemetryContract interfaces with enums. Review of attachment 8423441 [details] [diff] [review]: ----------------------------------------------------------------- Nice, this looks good. I wouldn't worry about the session/event concatenation - I'm sorry it's so ugly!
Attachment #8423441 -
Flags: review?(liuche) → review+
Assignee | ||
Comment 11•10 years ago
|
||
Fixed the NullPointerExceptions in the Try push from comment 9 - I used null instead of Method.NONE.
Attachment #8424064 -
Flags: review?(liuche)
Assignee | ||
Updated•10 years ago
|
Attachment #8423441 -
Attachment is obsolete: true
Assignee | ||
Comment 12•10 years ago
|
||
try (again): https://tbpl.mozilla.org/?tree=Try&rev=75c6b741c9a9
Comment 13•10 years ago
|
||
Landing Parts 1 & 2 for bug 1013672. https://hg.mozilla.org/integration/fx-team/rev/5ccd250f580e https://hg.mozilla.org/integration/fx-team/rev/7f1171701401
Keywords: leave-open
Comment 14•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/5ccd250f580e https://hg.mozilla.org/mozilla-central/rev/7f1171701401
Assignee | ||
Comment 15•10 years ago
|
||
try (try again): https://tbpl.mozilla.org/?tree=Try&rev=0cc962c00bd5 Will flag for review if green.
Assignee | ||
Updated•10 years ago
|
Attachment #8423502 -
Attachment is obsolete: true
Attachment #8423502 -
Flags: review?(liuche)
Assignee | ||
Comment 16•10 years ago
|
||
try(ing too hard?): https://tbpl.mozilla.org/?tree=Try&rev=b088bc6c6899
Attachment #8431092 -
Flags: review?(liuche)
Assignee | ||
Updated•10 years ago
|
Attachment #8429723 -
Attachment is obsolete: true
Comment 17•10 years ago
|
||
Comment on attachment 8424064 [details] [diff] [review] Part 3: Replace TelemetryContract interfaces with enums. Review of attachment 8424064 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. ::: mobile/android/base/Telemetry.java @@ +127,5 @@ > + public static void stopUISession(final Session session, final String sessionNameSuffix, > + final Reason reason) { > + final String sessionName = getSessionName(session, sessionNameSuffix); > + > + Log.d(LOGTAG, "StopUISession: " + sessionName + ", reason=" + reason); I assume this works fine with the NONE(null) enum? Nothing silly like null.toString() getting called to make the log message?
Attachment #8424064 -
Flags: review?(liuche) → review+
Assignee | ||
Comment 18•10 years ago
|
||
(In reply to Chenxia Liu [:liuche] from comment #17) > I assume this works fine with the NONE(null) enum? Nothing silly like > null.toString() getting called to make the log message? `NONE.toString` would be called, which only returns the value of `NONE.string`, which is `null`, so no, no silliness abound.
Assignee | ||
Comment 19•10 years ago
|
||
As discussed on IRC, added test values to the TelemetryContract enums, rather than keeping a set of String constants up to date with TelemetryContract in JS. This also has the benefit of removing non-test measurements from our assertions, making the test more robust. green try: https://tbpl.mozilla.org/?tree=Try&rev=79dc706e4332
Attachment #8431733 -
Flags: review?(liuche)
Assignee | ||
Updated•10 years ago
|
Attachment #8431092 -
Attachment is obsolete: true
Attachment #8431092 -
Flags: review?(liuche)
Comment 20•10 years ago
|
||
Comment on attachment 8431733 [details] [diff] [review] Part 4: Fix testUITelemetry. Review of attachment 8431733 [details] [diff] [review]: ----------------------------------------------------------------- Nice, just a few nits, all up to your judgment. ::: mobile/android/base/TelemetryContract.java @@ +142,5 @@ > + _TEST2("_test_method_2"), > + _TEST3("_test_method_3"), > + _TEST4("_test_method_4"), > + _TEST5("_test_method_5"), > + _TEST6("_test_method_6"), Do we need this many method enums? Can we just reuse some of them? That being said, I guess 2 test enums vs 6 test enums isn't a big deal. ::: mobile/android/base/tests/testUITelemetry.java @@ +29,5 @@ > + Telemetry.sendUIEvent(Event._TEST1, Method._TEST1); > + Telemetry.startUISession(Session._TEST_STARTED_TWICE); > + Telemetry.sendUIEvent(Event._TEST2, Method._TEST2); > + > + // We can only start one session per name, so this call is ignored. Maybe "so this call should be ignored" ? @@ +39,5 @@ > + Telemetry.stopUISession(Session._TEST_STARTED_TWICE, Reason._TEST1); > + Telemetry.sendUIEvent(Event._TEST4, Method._TEST5, "barextras"); > + Telemetry.stopUISession(Session._TEST_STOPPED_TWICE, Reason._TEST2); > + > + // This session is already stopped, so this call is ignored. same ::: mobile/android/base/tests/testUITelemetry.js @@ +34,5 @@ > } > } > > +/** > + * Asserts that the given measurements are equal. Assumes that an measurements typo: "an measurements" @@ +37,5 @@ > +/** > + * Asserts that the given measurements are equal. Assumes that an measurements > + * of type "event" have their sessions arrays sorted. > + */ > +function do_check_meas_eq(m1, m2) { Nit: even slighter preference for measurement @@ +54,5 @@ > + do_check_eq(m1.reason, m2.reason); > + break; > + > + default: > + do_throw("Unknown event type, " + m1.type); Nit: No comma? "type:" or just "type". @@ +130,5 @@ > + } > + }); > +} > + > +function filterNonTestMeasurements(measurements) { I'm not sure if filterX is intuitively filtering *out* something or applying a filter to allow everything else to pass. Maybe a comment, or maybe I'm just too easily confused. @@ +131,5 @@ > + }); > +} > + > +function filterNonTestMeasurements(measurements) { > + return measurements.filter(function (meas) { Nit: Slight preference for measurement vs meas.
Attachment #8431733 -
Flags: review?(liuche) → review+
Assignee | ||
Comment 21•10 years ago
|
||
(In reply to Chenxia Liu [:liuche] from comment #20) > Do we need this many method enums? Can we just reuse some of them? The idea was to ensure unique events for more specific testing, but yes, we can do that with 2.
Assignee | ||
Comment 22•10 years ago
|
||
Updated nits.
Assignee | ||
Updated•10 years ago
|
Attachment #8431733 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Attachment #8431984 -
Flags: review+
Assignee | ||
Comment 23•10 years ago
|
||
remote: https://hg.mozilla.org/integration/fx-team/rev/ee7ce47e5212 remote: https://hg.mozilla.org/integration/fx-team/rev/c4c655e1f8eb
Comment 24•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ee7ce47e5212 https://hg.mozilla.org/mozilla-central/rev/c4c655e1f8eb
Assignee | ||
Comment 25•10 years ago
|
||
Forgot to remove the leave-open tag.
Updated•10 years ago
|
Target Milestone: --- → Firefox 32
Updated•3 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•