|
|
DescriptionNQE: Cleanup observation buffer code
Rename network_quality_observation_unittest.cc to
observation_buffer_unittest.cc, and add a couple of more
tests.
BUG=649887
Committed: https://crrev.com/d10c267c2912344db828ffb3927024a5b83f3643
Cr-Commit-Position: refs/heads/master@{#422280}
Patch Set 1 : PS #
Total comments: 16
Patch Set 2 : Rebased, Addressed ryansturm comments #Patch Set 3 : ps #
Messages
Total messages: 45 (35 generated)
Description was changed from ========== ps BUG= ========== to ========== observation buffer code cleanup BUG= ==========
Patchset #1 (id:1) has been deleted
Patchset #1 (id:20001) has been deleted
Patchset #1 (id:40001) has been deleted
Description was changed from ========== observation buffer code cleanup BUG= ========== to ========== Observation buffer code cleanup Rename network_quality_observation_unittest.cc to observation_buffer_unittest.cc, and add a couple of more tests. BUG=649887 ==========
Description was changed from ========== Observation buffer code cleanup Rename network_quality_observation_unittest.cc to observation_buffer_unittest.cc, and add a couple of more tests. BUG=649887 ========== to ========== NQE: Cleanup observation buffer code Rename network_quality_observation_unittest.cc to observation_buffer_unittest.cc, and add a couple of more tests. BUG=649887 ==========
tbansal@chromium.org changed reviewers: + ryansturm@chromium.org
ryansturm: ptal. thanks.
https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... File net/nqe/observation_buffer.h (right): https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer.h:16: #include "base/time/default_tick_clock.h" This pulls in base/time/tick_clock.h, but you should probably include it as well due to the unique_ptr declared below. https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer.h:19: #include "net/nqe/network_quality_observation.h" Is network_quality_observation.h needed? https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer.h:77: ValueType* result, nit: Would you mind moving result to be the last parameter if it is an out param? Only make this change if you fix all the out-params in this file. https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer.h:122: void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock) { nit: Maybe add tick_clock as a parameter to the constructor. I prefer to avoid ForTesting methods when possible. https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... File net/nqe/observation_buffer_unittest.cc (right): https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer_unittest.cc:16: #include "net/nqe/network_quality_observation_source.h" #include "net/nqe/network_quality_observation.h" https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer_unittest.cc:23: namespace internal { nit: Why did you move to internal? Is that really providing any benefit? https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer_unittest.cc:40: // Verify that the percentiles are correctly computed when different "correctly" seems to imply that the values are decreasing at the correct rate. It looks like you are checking that the values are decreasing, but not necessarily at the right rate. Since you know this is geometric summing could you consider adding a a case with rate .5 that checks that the most recent item is worth more than half, and another case with rate .75 or 1 where the most recent item is worth less than half. If this is out of scope, just change the comment to be more accurate: "Verify that the percentiles are monotonically non-decreasing when a weight is applied" I also haven't looked at other tests in this file that might already check this functionality. https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer_unittest.cc:57: tick_clock_ptr->Advance(base::TimeDelta::FromSeconds(100)); Can you call Advance in the for loop above and instead of now + base::TimeDelta::FromSeconds(i) call NowTicks() every iteration?
The CQ bit was checked by tbansal@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Patchset #2 (id:80001) has been deleted
Patchset #2 (id:100001) has been deleted
ryansturm: ptal. thanks. https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... File net/nqe/observation_buffer.h (right): https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer.h:16: #include "base/time/default_tick_clock.h" On 2016/09/26 18:44:55, Ryan Sturm wrote: > This pulls in base/time/tick_clock.h, but you should probably include it as well > due to the unique_ptr declared below. Done. https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer.h:19: #include "net/nqe/network_quality_observation.h" On 2016/09/26 18:44:55, Ryan Sturm wrote: > Is network_quality_observation.h needed? Yes. See Line 174: std::deque<Observation<ValueType>> observations_; https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer.h:77: ValueType* result, On 2016/09/26 18:44:55, Ryan Sturm wrote: > nit: Would you mind moving result to be the last parameter if it is an out > param? > > Only make this change if you fix all the out-params in this file. Added TODO. https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer.h:122: void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock) { On 2016/09/26 18:44:55, Ryan Sturm wrote: > nit: Maybe add tick_clock as a parameter to the constructor. I prefer to avoid > ForTesting methods when possible. Seems like net tends to use ForTesting() rather than passing it in constructor: https://cs.chromium.org/search/?q=f:net+clock.*testing+-f:nqe&sq=package:chro... https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... File net/nqe/observation_buffer_unittest.cc (right): https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer_unittest.cc:16: #include "net/nqe/network_quality_observation_source.h" On 2016/09/26 18:44:55, Ryan Sturm wrote: > #include "net/nqe/network_quality_observation.h" Done. https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer_unittest.cc:23: namespace internal { On 2016/09/26 18:44:55, Ryan Sturm wrote: > nit: Why did you move to internal? Is that really providing any benefit? It avoids the need to prefix internal:: to some of the classes and data structures, and makes code less verbose. https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer_unittest.cc:40: // Verify that the percentiles are correctly computed when different On 2016/09/26 18:44:55, Ryan Sturm wrote: > "correctly" seems to imply that the values are decreasing at the correct rate. > It looks like you are checking that the values are decreasing, but not > necessarily at the right rate. Since you know this is geometric summing could > you consider adding a a case with rate .5 that checks that the most recent item > is worth more than half, and another case with rate .75 or 1 where the most > recent item is worth less than half. > > If this is out of scope, just change the comment to be more accurate: "Verify > that the percentiles are monotonically non-decreasing when a weight is applied" > > I also haven't looked at other tests in this file that might already check this > functionality. Done. https://codereview.chromium.org/2367143002/diff/60001/net/nqe/observation_buf... net/nqe/observation_buffer_unittest.cc:57: tick_clock_ptr->Advance(base::TimeDelta::FromSeconds(100)); On 2016/09/26 18:44:55, Ryan Sturm wrote: > Can you call Advance in the for loop above and instead of now + > base::TimeDelta::FromSeconds(i) call NowTicks() every iteration? Done.
The CQ bit was checked by tbansal@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lgtm. You could add more testing for testing more exactly the weighted exponential behavior, but this should be sufficient as is.
On 2016/09/28 17:14:23, Ryan Sturm wrote: > lgtm. You could add more testing for testing more exactly the weighted > exponential behavior, but this should be sufficient as is. Test PercentileDifferentTimestamps also covers part of this. It adds 50 observations with very recent timestamp, and another 50 observations with very old timestamp. Then, the test verifies that median values are closer to the values in the recent observations (and older observations have less weight).
tbansal@chromium.org changed reviewers: + bengr@chromium.org
bengr: ptal. Thanks.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...)
lgtm
Patchset #3 (id:140001) has been deleted
The CQ bit was checked by tbansal@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by tbansal@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #3 (id:160001) has been deleted
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Exceeded global retry quota
Patchset #3 (id:180001) has been deleted
The CQ bit was checked by tbansal@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by tbansal@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from bengr@chromium.org, ryansturm@chromium.org Link to the patchset: https://codereview.chromium.org/2367143002/#ps200001 (title: "ps")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== NQE: Cleanup observation buffer code Rename network_quality_observation_unittest.cc to observation_buffer_unittest.cc, and add a couple of more tests. BUG=649887 ========== to ========== NQE: Cleanup observation buffer code Rename network_quality_observation_unittest.cc to observation_buffer_unittest.cc, and add a couple of more tests. BUG=649887 ==========
Message was sent while issue was closed.
Committed patchset #3 (id:200001)
Message was sent while issue was closed.
Description was changed from ========== NQE: Cleanup observation buffer code Rename network_quality_observation_unittest.cc to observation_buffer_unittest.cc, and add a couple of more tests. BUG=649887 ========== to ========== NQE: Cleanup observation buffer code Rename network_quality_observation_unittest.cc to observation_buffer_unittest.cc, and add a couple of more tests. BUG=649887 Committed: https://crrev.com/d10c267c2912344db828ffb3927024a5b83f3643 Cr-Commit-Position: refs/heads/master@{#422280} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/d10c267c2912344db828ffb3927024a5b83f3643 Cr-Commit-Position: refs/heads/master@{#422280} |