Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/17725 )
Change subject: KUDU-3204: Add a metric for amount of available space ...................................................................... Patch Set 9: Code-Review+1 (3 comments) Missed the test in my last iteration. http://gerrit.cloudera.org:8080/#/c/17725/9/src/kudu/integration-tests/disk_failure-itest.cc File src/kudu/integration-tests/disk_failure-itest.cc: http://gerrit.cloudera.org:8080/#/c/17725/9/src/kudu/integration-tests/disk_failure-itest.cc@325 PS9, Line 325: We could do ASSERT_EQ of the metrics and the current available : // space but there will most likely be some data written between the two calls causing : // a failure. Sure we can't check that they're equal to each other, but could we check that the second time we get them they're the same as the previous time? I think that should be the case, given we cache the values. Consider fetching the metric again before restarting to exercise the caching functionality. http://gerrit.cloudera.org:8080/#/c/17725/9/src/kudu/integration-tests/disk_failure-itest.cc@330 PS9, Line 330: ASSERT_OK(itest::GetInt64Metric(cluster_->tablet_server(0)->bound_http_hostport(), : &METRIC_ENTITY_server, nullptr, &METRIC_wal_dir_space_available_bytes, "value", : &wal_dir_space)); : ASSERT_OK(itest::GetInt64Metric(cluster_->tablet_server(0)->bound_http_hostport(), : &METRIC_ENTITY_server, nullptr, &METRIC_data_dirs_space_available_bytes, "value", : &data_dir_space)); : nit: Given we're using this in a few places now (and maybe one more to come?), consider wrapping it in a lambda, defined just once. I.e. const auto get_metrics = [&] (int64_t* wal_dir_space, int64_t* data_dir_space) { RETURN_NOT_OK(itest::GetInt64Metric(cluster_->tablet_server(0)->bound_http_hostport(), &METRIC_ENTITY_server, nullptr, &METRIC_wal_dir_space_available_bytes, "value", wal_dir_space)); return itest::GetInt64Metric(cluster_->tablet_server(0)->bound_http_hostport(), &METRIC_ENTITY_server, nullptr, &METRIC_data_dirs_space_available_bytes, "value", data_dir_space); }; int64_t wal_dir_space; int64_t data_dir_space; ASSERT_OK(get_metrics(&wal_dir_space, &data_dir_space)); http://gerrit.cloudera.org:8080/#/c/17725/9/src/kudu/integration-tests/disk_failure-itest.cc@346 PS9, Line 346: Substitute( nit: there are no substitutions happening, so we can remove this. -- To view, visit http://gerrit.cloudera.org:8080/17725 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I58a7419847d080498aaf431d1dab098e1af71ad0 Gerrit-Change-Number: 17725 Gerrit-PatchSet: 9 Gerrit-Owner: Abhishek Chennaka <[email protected]> Gerrit-Reviewer: Abhishek Chennaka <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Attila Bukor <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241) Gerrit-Comment-Date: Wed, 18 Aug 2021 17:43:21 +0000 Gerrit-HasComments: Yes
