Ádám Bakai has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/22314 )

Change subject: KUDU-3563 Output tablet-level metrics in Prometheus
......................................................................


Patch Set 9:

(24 comments)

http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/master/master-test.cc
File src/kudu/master/master-test.cc:

http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/master/master-test.cc@3840
PS7, Line 3840: ma
> style nit: asterisk goes with the type
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/master/master-test.cc@3840
PS7, Line 3840: const
> nit: could this this be static constexpr?
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/master/master-test.cc@3854
PS7, Line 3854:
> nit: I'd expect this prefix isn't needed since this is already in kudu::mas
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/master/master-test.cc@3854
PS7, Line 3854:
> nit: could this be just 'buf.ToString()'?
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/tablet/tablet_metrics.cc
File src/kudu/tablet/tablet_metrics.cc:

http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/tablet/tablet_metrics.cc@129
PS7, Line 129:                       "to the Scanner Cells Returned metric."
> nit: add a space after the dot
I think space is not needed here. I checked the other metrics definitions and 
there is no space at the end of strings.


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/tablet/tablet_metrics.cc@141
PS7, Line 141:                       "to the Scanner Bytes Returned metric."
> nit: ditto
I think space is not needed here. I checked the other metrics definitions and 
there is no space at the end of strings.


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/tserver/tablet_server-test.cc
File src/kudu/tserver/tablet_server-test.cc:

http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/tserver/tablet_server-test.cc@4362
PS7, Line 4362:
> nit: could this be just 'buf.ToString()'?
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/tserver/tablet_server-test.cc@4362
PS7, Line 4362:
> nit: I'd think this prefix isn't necessary since this code is already in th
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/metrics-test.cc
File src/kudu/util/metrics-test.cc:

http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/metrics-test.cc@176
PS7, Line 176:     "# TY
> nit: in ASSERT_EQ() the expected comes first -- otherwise, it's quite hard
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/metrics.cc
File src/kudu/util/metrics.cc:

http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/metrics.cc@440
PS7, Line 440:   }
             :   const string prefix = Substitute("kudu_$0_$1_", 
prototype_->name(), id_);
             :   WriteMetricsPrometheus(writer, metrics, prefix);
             :   return Status::OK();
> nit: 'else' is redundant since there is 'return' in the 'if()' clause above
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/test_util.h
File src/kudu/util/test_util.h:

http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/test_util.h@221
PS7, Line 221: CheckPrometheusOutput
> It seems you missed addressing the nit on the method naming when posting PS
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/test_util.h@221
PS7, Line 221: CheckPrometheusOutput
> style nit: method names should start with capital letter unless that are pr
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/test_util.cc
File src/kudu/util/test_util.cc:

http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/test_util.cc@724
PS7, Line 724:
> nit here and below: remove the redundant 'std::' namespace prefix since the
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/test_util.cc@729
PS7, Line 729:   // Split the lines into groups. Every group contains a help 
line, a type line and
             :   // then lines with the actual metric values in this order.
             :   for (const auto& line : lines) {
             :
> Maybe, use strings::Split() instead?
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/test_util.cc@747
PS7, Line 747:     string name_from_type_line = 
vector<string>(strings::Split(group[1], " "))[2];
> nit for the pattern matching below: consider using ASSERT_STR_MATCHES() --
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/test_util.cc@750
PS7, Line 750:     << "T
> nit: with ASSERT_EQ(), the expected comes the first, so it's much easier to
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/test_util.cc@755
PS7, Line 755:
> nit here and below: add spaces to separate the operator
Done


http://gerrit.cloudera.org:8080/#/c/22314/7/src/kudu/util/test_util.cc@760
PS7, Line 760:
> nit: wrong indent?
Done


http://gerrit.cloudera.org:8080/#/c/22314/9/src/kudu/util/test_util.cc
File src/kudu/util/test_util.cc:

http://gerrit.cloudera.org:8080/#/c/22314/9/src/kudu/util/test_util.cc@732
PS9, Line 732: line.substr(0, 6) == "# HELP"
> nit: I missed mentioning this in prior rounds (probably, because I pointed
Done


http://gerrit.cloudera.org:8080/#/c/22314/9/src/kudu/util/test_util.cc@734
PS9, Line 734: line.substr(0, 6) == "# TYPE"
> ditto
Done


http://gerrit.cloudera.org:8080/#/c/22314/9/src/kudu/util/test_util.cc@746
PS9, Line 746: vector<string>(strings::Split(group[0], " "))[2]
> here and below: before trying to access an element at index 2, does it make
Done. I was thinking about as well. I thought that the indexing operator for 
vector will catch that, but maybe it is more informative to have an explicit 
check for it.


http://gerrit.cloudera.org:8080/#/c/22314/9/src/kudu/util/test_util.cc@749
PS9, Line 749:     ASSERT_TRUE(metric_names.find(name_from_help_line) == 
metric_names.end())
             :         << "The same metric is repeated.";
             :     metric_names.emplace(name_from_help_line);
> nit: consider switching to a concise and debug-friendly alternative
Done


http://gerrit.cloudera.org:8080/#/c/22314/9/src/kudu/util/test_util.cc@753
PS9, Line 753: ASSERT_EQ(group[i].substr(0, name_from_help_line.length()), 
name_from_help_line)
> nit: consider using HasPrefixString() here as well
Done


http://gerrit.cloudera.org:8080/#/c/22314/9/src/kudu/util/test_util.cc@754
PS9, Line 754: :
> nit: either add the expected metric name into the output or remove the trai
Done



--
To view, visit http://gerrit.cloudera.org:8080/22314
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id033a1410966167d9bb24f6a44c584e73c17a4af
Gerrit-Change-Number: 22314
Gerrit-PatchSet: 9
Gerrit-Owner: Ádám Bakai <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Attila Bukor <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <[email protected]>
Gerrit-Reviewer: Marton Greber <[email protected]>
Gerrit-Reviewer: Ádám Bakai <[email protected]>
Gerrit-Comment-Date: Mon, 03 Feb 2025 15:55:49 +0000
Gerrit-HasComments: Yes

Reply via email to