acelyc111 commented on code in PR #1237:
URL: 
https://github.com/apache/incubator-pegasus/pull/1237#discussion_r1021125261


##########
src/utils/metrics.h:
##########
@@ -131,6 +132,61 @@
 
 namespace dsn {
 
+using metric_fields_type = std::unordered_set<std::string>;
+
+// This struct includes a set of filters for both entities and metrics 
requested by client.
+struct metric_filters
+{
+    using fields_filter_fn = std::function<bool(const std::string &)>;
+
+    // According to the parameters requested by client, this function will 
filter metric
+    // fields that will be put in the response. `with_metric_fields` includes 
all the metric
+    // fields that are wanted by client; on the contrary, once client wants 
all except some
+    // metric fields, it could specify them in `without_metric_fields`.

Review Comment:
   It's a bit of complex, `without_metric_fields` use cases can be replaced by 
just using `with_metric_fields`.
   
   If **metric fields** have both `with` and `without` filters, do the **metric 
names**, **entity** have the 2 filters? I think it's rarely because there maybe 
dozens or hundreds of metrics/entities, how do a user just want metrics 
excludes a few ones?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to