Closed Bug 1133521 Opened 10 years ago Closed 10 years ago

Enable BHR on Beta

Categories

(Toolkit :: Telemetry, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox37 --- wontfix
firefox38 --- fixed
firefox39 --- fixed

People

(Reporter: rvitillo, Assigned: rvitillo)

References

Details

Attachments

(3 files, 7 obsolete files)

We would like to enable BHR on Beta for about 1% of the population, that should give us enough data without overloading our backend infrastructure.
Attached patch 1133521 - Enable BHR on Beta (obsolete) — Splinter Review
Attachment #8565066 - Flags: review?(nchen)
Assignee: nobody → rvitillo
Attached patch 1133521 (obsolete) — Splinter Review
Attachment #8565066 - Attachment is obsolete: true
Attachment #8565066 - Flags: review?(nchen)
Attachment #8565364 - Flags: review?(nchen)
Attachment #8565364 - Flags: review?(nchen) → review?(vdjeric)
Comment on attachment 8565364 [details] [diff] [review] 1133521 Review of attachment 8565364 [details] [diff] [review]: ----------------------------------------------------------------- ::: xpcom/threads/BackgroundHangMonitor.cpp @@ +453,5 @@ > return nullptr; > } > > +bool > +BackgroundHangMonitor::ShouldDisableOnBeta(nsAdoptingCString &clientID) { why nsAdoptingCString& ? why not const nsCString& ? @@ +456,5 @@ > +bool > +BackgroundHangMonitor::ShouldDisableOnBeta(nsAdoptingCString &clientID) { > + MOZ_ASSERT(clientID, "clientID is null"); > + const char *suffix = clientID.get() + clientID.Length() - 4; > + return strtol(suffix, NULL, 16) % 100; // Activate BHR only for ~ 1% of the Beta population make the 1% a define at the top of the file @@ +464,5 @@ > +BackgroundHangMonitor::IsDisabled() { > +#ifdef MOZ_ENABLE_BACKGROUND_HANG_MONITOR > + return BackgroundHangManager::sDisabled; > +#else > + return true missing semi-colon @@ +487,5 @@ > MOZ_ASSERT(!BackgroundHangManager::sInstance, "Already initialized"); > + > + if (NS_STRINGIFY(MOZ_UPDATE_CHANNEL) == "beta") { > + auto clientID = Preferences::GetCString("toolkit.telemetry.cachedClientID"); > + if (clientID && BackgroundHangMonitor::ShouldDisableOnBeta(clientID)) { What happens when the user opts-out of FHR collection during the first session or resets their profile? I think clientID would never get set, thus enabling BHR during all future sessions? ::: xpcom/threads/BackgroundHangMonitor.h @@ +110,5 @@ > private: > RefPtr<BackgroundHangThread> mThread; > > + static void PrefCallback(const char *, void *); > + static bool ShouldDisableOnBeta(nsAdoptingCString &); nit: ShouldEnableOnBeta? see next comment
Attachment #8565364 - Flags: review?(vdjeric)
(In reply to Vladan Djeric (:vladan) -- please needinfo! from comment #3) > Comment on attachment 8565364 [details] [diff] [review] > 1133521 > > Review of attachment 8565364 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: xpcom/threads/BackgroundHangMonitor.cpp > @@ +453,5 @@ > > return nullptr; > > } > > > > +bool > > +BackgroundHangMonitor::ShouldDisableOnBeta(nsAdoptingCString &clientID) { > > why nsAdoptingCString& ? why not const nsCString& ? Preferences::GetCString returns a nsAdoptingCString. > @@ +487,5 @@ > > MOZ_ASSERT(!BackgroundHangManager::sInstance, "Already initialized"); > > + > > + if (NS_STRINGIFY(MOZ_UPDATE_CHANNEL) == "beta") { > > + auto clientID = Preferences::GetCString("toolkit.telemetry.cachedClientID"); > > + if (clientID && BackgroundHangMonitor::ShouldDisableOnBeta(clientID)) { > > What happens when the user opts-out of FHR collection during the first > session or resets their profile? I think clientID would never get set, thus > enabling BHR during all future sessions? Good point. I addressed this in the updated patch. > ::: xpcom/threads/BackgroundHangMonitor.h > @@ +110,5 @@ > > private: > > RefPtr<BackgroundHangThread> mThread; > > > > + static void PrefCallback(const char *, void *); > > + static bool ShouldDisableOnBeta(nsAdoptingCString &); > > nit: ShouldEnableOnBeta? see next comment Which comment?
Attached patch 1133521 (obsolete) — Splinter Review
Attachment #8565364 - Attachment is obsolete: true
Attachment #8566461 - Flags: review?(vdjeric)
> > why nsAdoptingCString& ? why not const nsCString& ? > > Preferences::GetCString returns a nsAdoptingCString. I think Adopting[C]Strings are internal types used only for return types, so they're not used in function parameters. This method will only be called with the return values from Preferences::GetString() but it should still accept any CString. > > nit: ShouldEnableOnBeta? see next comment > > Which comment? I had written a commment (and then deleted it) about having BHR default to disabled on Beta, and then only enabling it after we get the clientID and confirm the client is one of the 1%. But I changed my mind about that
Comment on attachment 8566461 [details] [diff] [review] 1133521 Review of attachment 8566461 [details] [diff] [review]: ----------------------------------------------------------------- ::: xpcom/threads/BackgroundHangMonitor.cpp @@ +34,3 @@ > namespace mozilla { > > +class Observer : public nsIObserver Wouldn't it be simpler to have BackgroundHangManager inherit from nsIObserver instead?
Attachment #8566461 - Flags: review?(vdjeric)
Attached patch 1133521 (obsolete) — Splinter Review
Attachment #8566461 - Attachment is obsolete: true
Attachment #8569152 - Flags: review?(vdjeric)
Attachment #8569152 - Flags: review?(vdjeric) → review+
Hi, this failed to apply: patching file toolkit/components/telemetry/Telemetry.cpp Hunk #1 FAILED at 2898 1 out of 1 hunks FAILED -- saving rejects to file toolkit/components/telemetry/Telemetry.cpp.rej patch failed, unable to continue (try -v) could you take a look, thanks!
Flags: needinfo?(rvitillo)
Keywords: checkin-needed
Attached patch 1133521 (obsolete) — Splinter Review
Attachment #8571369 - Attachment is obsolete: true
Flags: needinfo?(rvitillo)
sorry had to back this out for causing crashes like https://treeherder.mozilla.org/logviewer.html#?job_id=2176938&repo=fx-team on android
Whiteboard: [fixed-in-fx-team]
Flags: needinfo?(rvitillo)
This caused widespread problems across multiple platforms. Please run a full Try push across all platforms before attempting to re-land.
Will do, sorry about that.
Flags: needinfo?(rvitillo)
Attached patch 1133521Splinter Review
Seems the issue was that BHR was getting enabled also on Debug builds.
Attachment #8571952 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → mozilla39
Attached patch 1133521_betaSplinter Review
Approval Request Comment [Feature/regressing bug #]: 1133521 [User impact if declined]: None [Describe test coverage new/current, TreeHerder]: landed on m-c on March-10 with tests [Risks and why]: Browser might be slightly less power friendly for a small fraction of the population that is going to have BHR enabled. [String/UUID change made/needed]: None
Attachment #8578683 - Flags: approval-mozilla-beta?
Attached patch 1133521_auroraSplinter Review
Approval Request Comment [Feature/regressing bug #]: 1133521 [User impact if declined]: None [Describe test coverage new/current, TreeHerder]: landed on m-c on March-10 with tests [Risks and why]: Low risk, this patch affects only Beta [String/UUID change made/needed]: None
Attachment #8578686 - Flags: approval-mozilla-aurora?
Attachment #8578686 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment on attachment 8578683 [details] [diff] [review] 1133521_beta We're at the end of the 37 Beta cycle with only one Beta build left. I think we should defer this work to 38 Beta. 38 Beta 1 is scheduled to release on Apr 2, 2015. Beta-
Attachment #8578683 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
Flags: needinfo?(rvitillo)
Flags: needinfo?(rvitillo)
Blocks: 1223800
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: