Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Issue 1334943003: metrics: Add RandomSelector, a class that randomly selects items with odds (Closed)

Created:
5 years, 3 months ago by dhsharp
Modified:
5 years, 3 months ago
CC:
chromium-reviews, asvitkine+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

metrics: Add RandomSelector, a class that randomly selects items with odds This class was originally added to debugd in ChromeOS to select perf command lines for CWP. That command selection is being moved up into Chrome, so this class needs to be moved here. It will be used by PerfProvider for the same purpose. Committed: https://crrev.com/85c2c2c4b76b0e6112dc03f640772bf164a548b9 Cr-Commit-Position: refs/heads/master@{#349298}

Patch Set 1 #

Patch Set 2 : Add constructor for OddsAndValue #

Total comments: 17

Patch Set 3 : Switch to string values. Respond to comments on PS2 #

Patch Set 4 : Moved to metrics/perf/ directory #

Total comments: 21

Patch Set 5 : Respond to comments on PS4 #

Total comments: 10

Patch Set 6 : Respond to comments on PS5 #

Total comments: 4

Patch Set 7 : Respond to comments on PS6 #

Total comments: 1

Patch Set 8 : Fix dumb error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+239 lines, -0 lines) Patch
A chrome/browser/metrics/perf/random_selector.h View 1 2 3 4 5 6 1 chunk +79 lines, -0 lines 0 comments Download
A chrome/browser/metrics/perf/random_selector.cc View 1 2 3 4 5 6 7 1 chunk +51 lines, -0 lines 0 comments Download
A chrome/browser/metrics/perf/random_selector_unittest.cc View 1 2 3 4 1 chunk +106 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 28 (8 generated)
dhsharp
Not sure if this is the best place to put this code. I just put ...
5 years, 3 months ago (2015-09-11 00:53:31 UTC) #2
Simon Que
On 2015/09/11 00:53:31, dhsharp wrote: > Not sure if this is the best place to ...
5 years, 3 months ago (2015-09-11 00:56:15 UTC) #3
Alexei Svitkine (slow)
https://codereview.chromium.org/1334943003/diff/20001/chrome/browser/metrics/random_selector.cc File chrome/browser/metrics/random_selector.cc (right): https://codereview.chromium.org/1334943003/diff/20001/chrome/browser/metrics/random_selector.cc#newcode5 chrome/browser/metrics/random_selector.cc:5: #include "chrome/browser/metrics/random_selector.h" I'm not convinced of this living in ...
5 years, 3 months ago (2015-09-11 21:00:55 UTC) #4
dhsharp
https://codereview.chromium.org/1334943003/diff/20001/chrome/browser/metrics/random_selector.cc File chrome/browser/metrics/random_selector.cc (right): https://codereview.chromium.org/1334943003/diff/20001/chrome/browser/metrics/random_selector.cc#newcode5 chrome/browser/metrics/random_selector.cc:5: #include "chrome/browser/metrics/random_selector.h" On 2015/09/11 21:00:54, Alexei Svitkine wrote: > ...
5 years, 3 months ago (2015-09-11 22:53:25 UTC) #5
dhsharp
Okay, moved to metrics/perf.
5 years, 3 months ago (2015-09-12 00:18:26 UTC) #6
Alexei Svitkine (slow)
https://codereview.chromium.org/1334943003/diff/60001/chrome/browser/metrics/perf/random_selector.cc File chrome/browser/metrics/perf/random_selector.cc (right): https://codereview.chromium.org/1334943003/diff/60001/chrome/browser/metrics/perf/random_selector.cc#newcode47 chrome/browser/metrics/perf/random_selector.cc:47: const std::string& RandomSelector::GetKeyOf(double value) { The name key in ...
5 years, 3 months ago (2015-09-14 19:12:34 UTC) #7
dhsharp
https://codereview.chromium.org/1334943003/diff/60001/chrome/browser/metrics/perf/random_selector.cc File chrome/browser/metrics/perf/random_selector.cc (right): https://codereview.chromium.org/1334943003/diff/60001/chrome/browser/metrics/perf/random_selector.cc#newcode47 chrome/browser/metrics/perf/random_selector.cc:47: const std::string& RandomSelector::GetKeyOf(double value) { On 2015/09/14 19:12:33, Alexei ...
5 years, 3 months ago (2015-09-15 00:00:22 UTC) #8
Alexei Svitkine (slow)
https://codereview.chromium.org/1334943003/diff/60001/chrome/browser/metrics/perf/random_selector.cc File chrome/browser/metrics/perf/random_selector.cc (right): https://codereview.chromium.org/1334943003/diff/60001/chrome/browser/metrics/perf/random_selector.cc#newcode56 chrome/browser/metrics/perf/random_selector.cc:56: return base::EmptyString(); On 2015/09/15 00:00:21, dhsharp wrote: > On ...
5 years, 3 months ago (2015-09-15 15:31:18 UTC) #9
dhsharp
https://codereview.chromium.org/1334943003/diff/60001/chrome/chrome_browser.gypi File chrome/chrome_browser.gypi (right): https://codereview.chromium.org/1334943003/diff/60001/chrome/chrome_browser.gypi#newcode1875 chrome/chrome_browser.gypi:1875: 'browser/metrics/perf/random_selector.cc', On 2015/09/15 15:31:18, Alexei Svitkine wrote: > On ...
5 years, 3 months ago (2015-09-15 18:21:32 UTC) #10
Alexei Svitkine (slow)
lgtm https://codereview.chromium.org/1334943003/diff/100001/chrome/browser/metrics/perf/random_selector.h File chrome/browser/metrics/perf/random_selector.h (right): https://codereview.chromium.org/1334943003/diff/100001/chrome/browser/metrics/perf/random_selector.h#newcode30 chrome/browser/metrics/perf/random_selector.h:30: // std::vector<std::string>& selection = random_selector.Select(); Nit: I find ...
5 years, 3 months ago (2015-09-15 18:36:12 UTC) #11
dhsharp
https://codereview.chromium.org/1334943003/diff/100001/chrome/browser/metrics/perf/random_selector.h File chrome/browser/metrics/perf/random_selector.h (right): https://codereview.chromium.org/1334943003/diff/100001/chrome/browser/metrics/perf/random_selector.h#newcode30 chrome/browser/metrics/perf/random_selector.h:30: // std::vector<std::string>& selection = random_selector.Select(); On 2015/09/15 18:36:12, Alexei ...
5 years, 3 months ago (2015-09-16 01:01:40 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1334943003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1334943003/120001
5 years, 3 months ago (2015-09-16 01:02:06 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/63364)
5 years, 3 months ago (2015-09-16 01:10:17 UTC) #17
Simon Que
On 2015/09/16 01:10:17, commit-bot: I haz the power wrote: > Try jobs failed on following ...
5 years, 3 months ago (2015-09-16 01:12:38 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1334943003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1334943003/120001
5 years, 3 months ago (2015-09-16 19:15:12 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-generic_chromium_compile_only_ng/builds/33119) chromeos_daisy_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, ...
5 years, 3 months ago (2015-09-16 19:34:04 UTC) #22
Simon Que
https://codereview.chromium.org/1334943003/diff/120001/chrome/browser/metrics/perf/random_selector.cc File chrome/browser/metrics/perf/random_selector.cc (right): https://codereview.chromium.org/1334943003/diff/120001/chrome/browser/metrics/perf/random_selector.cc#newcode15 chrome/browser/metrics/perf/random_selector.cc:15: RandomSelector::~RandomSelector() : sum_of_weights_(0) {} You have constructor and destructor ...
5 years, 3 months ago (2015-09-16 21:38:41 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1334943003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1334943003/140001
5 years, 3 months ago (2015-09-16 22:46:25 UTC) #26
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 3 months ago (2015-09-17 00:49:29 UTC) #27
commit-bot: I haz the power
5 years, 3 months ago (2015-09-17 00:50:45 UTC) #28
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/85c2c2c4b76b0e6112dc03f640772bf164a548b9
Cr-Commit-Position: refs/heads/master@{#349298}

Powered by Google App Engine
This is Rietveld 408576698