Adar Dembo has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/13580 )

Change subject: [metrics] Merge metrics by the same attribute
......................................................................


Patch Set 6:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/13580/6/src/kudu/util/metrics.h
File src/kudu/util/metrics.h:

http://gerrit.cloudera.org:8080/#/c/13580/6/src/kudu/util/metrics.h@478
PS6, Line 478: will not take effect.
i.e. "will not be merged"?


http://gerrit.cloudera.org:8080/#/c/13580/5/src/kudu/util/metrics.h
File src/kudu/util/metrics.h:

http://gerrit.cloudera.org:8080/#/c/13580/5/src/kudu/util/metrics.h@467
PS5, Line 467:
> I'm using scoped_refptr<MergeAttributes> as value type in merge_attributes_
Why not just use the struct directly? Or, in the worst case, you can wrap it in 
a unique_ptr. The RefCounted business means unnecessary 
incrementing/decrementing of counts, plus confusion for readers (who will think 
you actually _need_ shared ownership when you don't).

BTW I think you can use FindOrNull if the value were the struct directly: you'd 
be retrieving a pointer to the value in the map.


http://gerrit.cloudera.org:8080/#/c/13580/5/src/kudu/util/metrics.h@627
PS5, Line 627:   Status CollectTo(MetricCollection* collections,
> Done
Doc (and use MetricFilters here?)


http://gerrit.cloudera.org:8080/#/c/13580/5/src/kudu/util/metrics.h@1057
PS5, Line 1057:     // call DetachToCurrentValue() to make it safe.
              :     
down_cast<FunctionGauge<T>*>(m.get())->DetachToCurrentValue();
              :     return m;
> Emm, I agree. How about rename 'clone' to 'snapshot'? clone is not a rigid
That'd be fine. In the base class please doc the contract.


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

http://gerrit.cloudera.org:8080/#/c/13580/6/src/kudu/util/metrics.cc@682
PS6, Line 682: void StringGauge::fill_unique_values_unlock() {
Only used on L690, so why not inline it there?



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8db3d082ae847eb1d83b9e4aee57d5e4bf13e1b5
Gerrit-Change-Number: 13580
Gerrit-PatchSet: 6
Gerrit-Owner: Yingchun Lai <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Yingchun Lai <[email protected]>
Gerrit-Comment-Date: Thu, 11 Jul 2019 23:13:11 +0000
Gerrit-HasComments: Yes

Reply via email to