You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by "empiredan (via GitHub)" <gi...@apache.org> on 2023/05/30 03:22:06 UTC

[GitHub] [incubator-pegasus] empiredan commented on a diff in pull request #1491: refactor(new_metrics): refactor enum definition for metric types and units

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


##########
src/utils/enum_helper.h:
##########
@@ -66,6 +66,11 @@
 
 #define ENUM_END(type) ENUM_END2(type, type)
 
+#define ENUM_CONST(str) k##str
+#define ENUM_CONST_DEF(str) ENUM_CONST(str),
+#define ENUM_CONST_REG_STR(enum_class, str)                                                        \
+    helper->register_enum(#str, enum_class::ENUM_CONST(str));

Review Comment:
   OK, I'll add some test cases.



##########
src/utils/enum_helper.h:
##########
@@ -66,6 +66,11 @@
 
 #define ENUM_END(type) ENUM_END2(type, type)
 
+#define ENUM_CONST(str) k##str
+#define ENUM_CONST_DEF(str) ENUM_CONST(str),
+#define ENUM_CONST_REG_STR(enum_class, str)                                                        \
+    helper->register_enum(#str, enum_class::ENUM_CONST(str));

Review Comment:
   OK, I'll add some sample comments to describe how to use these macros.



##########
src/replica/test/replica_disk_test_base.h:
##########
@@ -57,7 +57,6 @@ class replica_disk_test_base : public replica_test_base
         generate_mock_app_info();
 
         stub->_fs_manager._dir_nodes.clear();
-        stub->_fs_manager.reset_disk_stat();

Review Comment:
   Actually this resulted from rebasing `master` branch. In [master](https://github.com/apache/incubator-pegasus/blob/master/src/replica/test/replica_disk_test_base.h#L60) branch, this line was newly added, while it has been removed in `migrate-metrics-dev` branch. After rebasing, `migrate-metrics-dev` has this line which should have been dropped.



-- 
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