You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2022/12/01 12:38:01 UTC

[GitHub] [incubator-pegasus] empiredan commented on a diff in pull request #1258: feat(new_metrics): take snapshot of each entity as json format

empiredan commented on code in PR #1258:
URL: https://github.com/apache/incubator-pegasus/pull/1258#discussion_r1037059161


##########
src/utils/metrics.h:
##########
@@ -209,8 +201,19 @@ class metric_entity : public ref_counter
     };
     void close(close_option option);
 
-    void set_attributes(attr_map &&attrs);
+    void set_attributes(const attr_map &attrs);
+
+    void encode_type(metric_json_writer &writer) const;
+
+    void encode_id(metric_json_writer &writer) const;
+
+    static void encode_attrs(metric_json_writer &writer, const attr_map &attrs);

Review Comment:
   Good advice, I'll move this function to `.cpp`. 



##########
src/utils/metrics.h:
##########
@@ -209,8 +201,19 @@ class metric_entity : public ref_counter
     };
     void close(close_option option);
 
-    void set_attributes(attr_map &&attrs);
+    void set_attributes(const attr_map &attrs);
+
+    void encode_type(metric_json_writer &writer) const;
+
+    void encode_id(metric_json_writer &writer) const;
+
+    static void encode_attrs(metric_json_writer &writer, const attr_map &attrs);
 
+    static void encode_metrics(metric_json_writer &writer,

Review Comment:
   OK.



-- 
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: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org