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

[GitHub] [incubator-pegasus] GehaFearless opened a new pull request, #1373: refactor(test): add bench type multi set/get

GehaFearless opened a new pull request, #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373

   Issue: https://github.com/apache/incubator-pegasus/issues/1372


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


[GitHub] [incubator-pegasus] acelyc111 commented on a diff in pull request #1373: feat(test): add bench type multi set/get

Posted by "acelyc111 (via GitHub)" <gi...@apache.org>.
acelyc111 commented on code in PR #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373#discussion_r1122545010


##########
src/test/bench_test/benchmark.cpp:
##########
@@ -170,6 +192,49 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // Generate hash key.
+        std::string hashkey;
+        hashkey = generate_string(FLAGS_hashkey_size);

Review Comment:
   ```suggestion
           std::string hashkey = generate_string(FLAGS_hashkey_size);
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -54,15 +54,35 @@ DSN_DEFINE_string(
     "Comma-separated list of operations to run in the specified order. Available benchmarks:\n"
     "\tfillrandom_pegasus       -- pegasus write N values in random key order\n"
     "\treadrandom_pegasus       -- pegasus read N times in random order\n"
-    "\tdeleterandom_pegasus     -- pegasus delete N keys in random order\n");
+    "\tdeleterandom_pegasus     -- pegasus delete N keys in random order\n"
+    "\tmultisetrandom_pegasus   -- pegasus write N random values with multi_count hash keys list\n"
+    "\tmultigetrandom_pegasus   -- pegasus read N random keys with multi_count hash list\n");
+
 DSN_DEFINE_validator(benchmarks,
                      [](const char *value) -> bool { return !dsn::utils::is_empty(value); });
 
-DSN_DECLARE_int32(hashkey_size);
-DSN_DECLARE_int32(pegasus_timeout_ms);
-DSN_DECLARE_int32(sortkey_size);
-DSN_DECLARE_int32(threads);
-DSN_DECLARE_int32(value_size);
+DSN_DEFINE_int32(pegasus.benchmark,
+                 pegasus_timeout_ms,
+                 1000,
+                 "pegasus read/write timeout in milliseconds");
+DSN_DEFINE_int32(pegasus.benchmark, threads, 1, "Number of concurrent threads to run");
+DSN_DEFINE_int32(pegasus.benchmark, hashkey_size, 16, "size of each hashkey");
+DSN_DEFINE_int32(pegasus.benchmark, sortkey_size, 16, "size of each sortkey");

Review Comment:
   ```suggestion
   DSN_DEFINE_int32(pegasus.benchmark, hashkey_size, 16, "Size of each hashkey");
   DSN_DEFINE_int32(pegasus.benchmark, sortkey_size, 16, "Size of each sortkey");
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -170,6 +192,49 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // Generate hash key.
+        std::string hashkey;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+
+        // Generate sort key and value.
+        std::string sortkey, value;
+        for (int j = 0; j < FLAGS_multi_count; j++) {
+            sortkey = generate_string(FLAGS_sortkey_size);
+            value = generate_string(FLAGS_value_size);
+            kvs.emplace(sortkey, value);
+        }
+
+        // Write to pegasus.
+        int try_count = 0;
+        while (true) {
+            try_count++;
+            int ret = _client->multi_set(hashkey, kvs, FLAGS_pegasus_timeout_ms);
+            if (ret == ::pegasus::PERR_OK) {
+                bytes += (FLAGS_value_size + FLAGS_hashkey_size + FLAGS_sortkey_size) *
+                         FLAGS_multi_count;
+                break;
+            }
+            if (ret != ::pegasus::PERR_TIMEOUT || try_count > 3) {
+                fmt::print(stderr, "Set returned an error: {}\n", _client->get_error_string(ret));

Review Comment:
   ```suggestion
                   fmt::print(stderr, "multi_set returned an error: {}\n", _client->get_error_string(ret));
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -170,6 +192,49 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // Generate hash key.
+        std::string hashkey;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+
+        // Generate sort key and value.
+        std::string sortkey, value;
+        for (int j = 0; j < FLAGS_multi_count; j++) {
+            sortkey = generate_string(FLAGS_sortkey_size);
+            value = generate_string(FLAGS_value_size);
+            kvs.emplace(sortkey, value);
+        }
+
+        // Write to pegasus.
+        int try_count = 0;
+        while (true) {
+            try_count++;
+            int ret = _client->multi_set(hashkey, kvs, FLAGS_pegasus_timeout_ms);
+            if (ret == ::pegasus::PERR_OK) {
+                bytes += (FLAGS_value_size + FLAGS_hashkey_size + FLAGS_sortkey_size) *
+                         FLAGS_multi_count;
+                break;
+            }
+            if (ret != ::pegasus::PERR_TIMEOUT || try_count > 3) {
+                fmt::print(stderr, "Set returned an error: {}\n", _client->get_error_string(ret));
+                dsn_exit(1);
+            }
+            fmt::print(stderr, "Set timeout, retry({})\n", try_count);

Review Comment:
   ```suggestion
               fmt::print(stderr, "multi_set timeout, retry({})\n", try_count);
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -209,6 +274,62 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+    uint64_t found = 0;
+    int max_fetch_count = 100;
+    int max_fetch_size = 1000000;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // Generate hash key.
+        std::string hashkey;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+        std::set<std::string> sortkeys;
+
+        // Generate sort key.
+        // Generate value for random to keep in peace with write.
+        for (int j = 0; j < FLAGS_multi_count; j++) {
+            sortkeys.insert(generate_string(FLAGS_sortkey_size));
+            // Make output string be sorted like multi_set_random.
+            generate_string(FLAGS_value_size);
+        }
+
+        // Read from pegasus.
+        int try_count = 0;
+        while (true) {
+            try_count++;
+            int ret = _client->multi_get(
+                hashkey, sortkeys, kvs, max_fetch_count, max_fetch_size, FLAGS_pegasus_timeout_ms);
+            if (ret == ::pegasus::PERR_OK) {
+                found += kvs.size();
+                bytes += FLAGS_multi_count * hashkey.size();
+                for (auto &kv : kvs) {

Review Comment:
   ```suggestion
                   for (const auto &kv : kvs) {
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -209,6 +274,62 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+    uint64_t found = 0;
+    int max_fetch_count = 100;
+    int max_fetch_size = 1000000;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // Generate hash key.
+        std::string hashkey;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+        std::set<std::string> sortkeys;
+
+        // Generate sort key.
+        // Generate value for random to keep in peace with write.
+        for (int j = 0; j < FLAGS_multi_count; j++) {
+            sortkeys.insert(generate_string(FLAGS_sortkey_size));
+            // Make output string be sorted like multi_set_random.
+            generate_string(FLAGS_value_size);
+        }
+
+        // Read from pegasus.
+        int try_count = 0;
+        while (true) {
+            try_count++;
+            int ret = _client->multi_get(
+                hashkey, sortkeys, kvs, max_fetch_count, max_fetch_size, FLAGS_pegasus_timeout_ms);
+            if (ret == ::pegasus::PERR_OK) {
+                found += kvs.size();
+                bytes += FLAGS_multi_count * hashkey.size();
+                for (auto &kv : kvs) {
+                    bytes = kv.first.size() + kv.second.size() + bytes;
+                }
+                break;
+            }
+            if (ret == ::pegasus::PERR_NOT_FOUND) {
+                break;
+            }
+            if (ret != ::pegasus::PERR_TIMEOUT || try_count > 3) {
+                fmt::print(stderr, "Get returned an error: {}\n", _client->get_error_string(ret));
+                dsn_exit(1);
+            }
+            fmt::print(stderr, "Get timeout, retry({})\n", try_count);

Review Comment:
   ```suggestion
               fmt::print(stderr, "multi_get timeout, retry({})\n", try_count);
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -54,15 +54,35 @@ DSN_DEFINE_string(
     "Comma-separated list of operations to run in the specified order. Available benchmarks:\n"
     "\tfillrandom_pegasus       -- pegasus write N values in random key order\n"
     "\treadrandom_pegasus       -- pegasus read N times in random order\n"
-    "\tdeleterandom_pegasus     -- pegasus delete N keys in random order\n");
+    "\tdeleterandom_pegasus     -- pegasus delete N keys in random order\n"
+    "\tmultisetrandom_pegasus   -- pegasus write N random values with multi_count hash keys list\n"
+    "\tmultigetrandom_pegasus   -- pegasus read N random keys with multi_count hash list\n");
+
 DSN_DEFINE_validator(benchmarks,
                      [](const char *value) -> bool { return !dsn::utils::is_empty(value); });
 
-DSN_DECLARE_int32(hashkey_size);
-DSN_DECLARE_int32(pegasus_timeout_ms);
-DSN_DECLARE_int32(sortkey_size);
-DSN_DECLARE_int32(threads);
-DSN_DECLARE_int32(value_size);
+DSN_DEFINE_int32(pegasus.benchmark,
+                 pegasus_timeout_ms,
+                 1000,
+                 "pegasus read/write timeout in milliseconds");
+DSN_DEFINE_int32(pegasus.benchmark, threads, 1, "Number of concurrent threads to run");
+DSN_DEFINE_int32(pegasus.benchmark, hashkey_size, 16, "size of each hashkey");
+DSN_DEFINE_int32(pegasus.benchmark, sortkey_size, 16, "size of each sortkey");
+DSN_DEFINE_int32(pegasus.benchmark, value_size, 100, "Size of each value");
+DSN_DEFINE_int32(pegasus.benchmark, multi_count, 100, "Values count of the same hashkey");
+
+DSN_DEFINE_group_validator(multi_count, [](std::string &message) -> bool {
+    std::string operation_type = FLAGS_benchmarks;
+    if ((operation_type == "multisetrandom_pegasus" ||
+         operation_type == "multigetrandom_pegasus") &&
+        FLAGS_benchmark_num % FLAGS_multi_count != 0) {
+        message = fmt::format("num {} should be a multiple of multi_count({}).",

Review Comment:
   Users will be confused about what is `num` or `multi_count`
   ```suggestion
           message = fmt::format("[pegasus.benchmark].benchmark_num {} should be a multiple of [pegasus.benchmark].multi_count({}).",
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -170,6 +192,49 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // Generate hash key.
+        std::string hashkey;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+
+        // Generate sort key and value.

Review Comment:
   ```suggestion
   
           // Generate sort key and value.
           std::map<std::string, std::string> kvs;
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -209,6 +274,62 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+    uint64_t found = 0;
+    int max_fetch_count = 100;
+    int max_fetch_size = 1000000;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // Generate hash key.
+        std::string hashkey;
+        hashkey = generate_string(FLAGS_hashkey_size);

Review Comment:
   ```suggestion
           std::string hashkey = generate_string(FLAGS_hashkey_size);
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -209,6 +274,62 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+    uint64_t found = 0;
+    int max_fetch_count = 100;
+    int max_fetch_size = 1000000;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // Generate hash key.
+        std::string hashkey;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+        std::set<std::string> sortkeys;
+
+        // Generate sort key.
+        // Generate value for random to keep in peace with write.

Review Comment:
   ```suggestion
   
           // Generate sort key.
           // Generate value for random to keep in peace with write.
           std::map<std::string, std::string> kvs;
           std::set<std::string> sortkeys;
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -170,6 +192,49 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // Generate hash key.
+        std::string hashkey;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+
+        // Generate sort key and value.
+        std::string sortkey, value;
+        for (int j = 0; j < FLAGS_multi_count; j++) {
+            sortkey = generate_string(FLAGS_sortkey_size);
+            value = generate_string(FLAGS_value_size);
+            kvs.emplace(sortkey, value);
+        }
+
+        // Write to pegasus.

Review Comment:
   ```suggestion
           // Write to Pegasus.
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -209,6 +274,62 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+    uint64_t found = 0;
+    int max_fetch_count = 100;
+    int max_fetch_size = 1000000;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // Generate hash key.
+        std::string hashkey;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+        std::set<std::string> sortkeys;
+
+        // Generate sort key.
+        // Generate value for random to keep in peace with write.
+        for (int j = 0; j < FLAGS_multi_count; j++) {
+            sortkeys.insert(generate_string(FLAGS_sortkey_size));
+            // Make output string be sorted like multi_set_random.
+            generate_string(FLAGS_value_size);
+        }
+
+        // Read from pegasus.
+        int try_count = 0;
+        while (true) {
+            try_count++;
+            int ret = _client->multi_get(
+                hashkey, sortkeys, kvs, max_fetch_count, max_fetch_size, FLAGS_pegasus_timeout_ms);
+            if (ret == ::pegasus::PERR_OK) {
+                found += kvs.size();
+                bytes += FLAGS_multi_count * hashkey.size();
+                for (auto &kv : kvs) {
+                    bytes = kv.first.size() + kv.second.size() + bytes;
+                }
+                break;
+            }
+            if (ret == ::pegasus::PERR_NOT_FOUND) {
+                break;
+            }
+            if (ret != ::pegasus::PERR_TIMEOUT || try_count > 3) {
+                fmt::print(stderr, "Get returned an error: {}\n", _client->get_error_string(ret));

Review Comment:
   ```suggestion
                   fmt::print(stderr, "multi_get returned an error: {}\n", _client->get_error_string(ret));
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -209,6 +274,62 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+    uint64_t found = 0;
+    int max_fetch_count = 100;
+    int max_fetch_size = 1000000;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // Generate hash key.
+        std::string hashkey;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+        std::set<std::string> sortkeys;
+
+        // Generate sort key.
+        // Generate value for random to keep in peace with write.
+        for (int j = 0; j < FLAGS_multi_count; j++) {
+            sortkeys.insert(generate_string(FLAGS_sortkey_size));
+            // Make output string be sorted like multi_set_random.
+            generate_string(FLAGS_value_size);
+        }
+
+        // Read from pegasus.

Review Comment:
   ```suggestion
           // Read from Pegasus.
   ```



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


[GitHub] [incubator-pegasus] acelyc111 commented on a diff in pull request #1373: feat(test): add bench type multi set/get

Posted by "acelyc111 (via GitHub)" <gi...@apache.org>.
acelyc111 commented on code in PR #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373#discussion_r1122540670


##########
src/test/bench_test/benchmark.cpp:
##########
@@ -54,15 +54,35 @@ DSN_DEFINE_string(
     "Comma-separated list of operations to run in the specified order. Available benchmarks:\n"
     "\tfillrandom_pegasus       -- pegasus write N values in random key order\n"
     "\treadrandom_pegasus       -- pegasus read N times in random order\n"
-    "\tdeleterandom_pegasus     -- pegasus delete N keys in random order\n");
+    "\tdeleterandom_pegasus     -- pegasus delete N keys in random order\n"
+    "\tmultisetrandom_pegasus   --pegasus write N random values with multi_count hash keys list\n"
+    "\tmultigetrandom_pegasus   --pegasus read N random keys with multi_count hash list\n");

Review Comment:
   ```suggestion
       "\tmultisetrandom_pegasus   -- pegasus write N random values with multi_count hash keys list\n"
       "\tmultigetrandom_pegasus   -- pegasus read N random keys with multi_count hash list\n");
   ```



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


[GitHub] [incubator-pegasus] GehaFearless commented on a diff in pull request #1373: refactor(test): add bench type multi set/get

Posted by "GehaFearless (via GitHub)" <gi...@apache.org>.
GehaFearless commented on code in PR #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373#discussion_r1119919909


##########
src/test/bench_test/benchmark.cpp:
##########
@@ -191,6 +235,58 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)

Review Comment:
   Do you means the count of values for the same hashkey? 
   To reuse params nums for other tests, I gave it a default number of 100. Refactoring is complex, and I think it's enough here to expose some problems



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


[GitHub] [incubator-pegasus] Smityz commented on a diff in pull request #1373: refactor(test): add bench type multi set/get

Posted by "Smityz (via GitHub)" <gi...@apache.org>.
Smityz commented on code in PR #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373#discussion_r1121145613


##########
src/test/bench_test/benchmark.cpp:
##########
@@ -191,6 +235,58 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)

Review Comment:
   Can we control the hit rate? Or is it stable?



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


[GitHub] [incubator-pegasus] GehaFearless commented on a diff in pull request #1373: feat(test): add bench type multi set/get

Posted by "GehaFearless (via GitHub)" <gi...@apache.org>.
GehaFearless commented on code in PR #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373#discussion_r1121730582


##########
src/test/bench_test/benchmark.cpp:
##########
@@ -152,6 +155,57 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    if (FLAGS_benchmark_num % FLAGS_multi_count != 0) {
+        fmt::print(stderr,
+                   "num {} should be a multiple of multi_count({}).\n",
+                   FLAGS_benchmark_num,
+                   FLAGS_multi_count);
+        dsn_exit(1);
+    }
+
+    // do write operation num times
+    uint64_t bytes = 0;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // generate hash key
+        std::string hash_key, sort_key, value;
+        hash_key = generate_string(FLAGS_hashkey_size);

Review Comment:
   It will make trouble.The argument list is built from right to left.



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


[GitHub] [incubator-pegasus] Smityz commented on a diff in pull request #1373: feat(test): add bench type multi set/get

Posted by "Smityz (via GitHub)" <gi...@apache.org>.
Smityz commented on code in PR #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373#discussion_r1122658258


##########
src/test/bench_test/benchmark.cpp:
##########
@@ -191,6 +235,58 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)

Review Comment:
   okay~



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


[GitHub] [incubator-pegasus] acelyc111 commented on a diff in pull request #1373: refactor(test): add bench type multi set/get

Posted by "acelyc111 (via GitHub)" <gi...@apache.org>.
acelyc111 commented on code in PR #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373#discussion_r1120110793


##########
src/test/bench_test/statistics.cpp:
##########
@@ -26,7 +26,12 @@
 namespace pegasus {
 namespace test {
 std::unordered_map<operation_type, std::string, std::hash<unsigned char>> operation_type_string = {
-    {kUnknown, "unKnown"}, {kRead, "read"}, {kWrite, "write"}, {kDelete, "delete"}};
+    {kUnknown, "unKnown"},
+    {kRead, "read"},
+    {kWrite, "write"},
+    {kDelete, "delete"},
+    {kMultiSet, "multiset"},
+    {kMultiGet, "multiget"}};

Review Comment:
   ```suggestion
       {kMultiSet, "multiSet"},
       {kMultiGet, "multiGet"}};
   ```



##########
run.sh:
##########
@@ -1399,6 +1399,8 @@ function usage_bench()
     echo "                             fillrandom_pegasus       --pegasus write N random values with random keys list"
     echo "                             readrandom_pegasus       --pegasus read N times with random keys list"
     echo "                             deleterandom_pegasus     --pegasus delete N entries with random keys list"
+    echo "                             multisetrandom_pegasus   --pegasus write (N/100)*100 random values with N/100 random keys list"

Review Comment:
   What dose `(N/100)*100` mean?



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -191,6 +235,58 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+    uint64_t found = 0;
+    int max_fetch_count = 100;
+    int max_fetch_size = 1000000;
+
+    for (int i = 0; i < FLAGS_benchmark_num / 100; i++) {
+
+        // generate hash key
+        std::string hashkey, sort_key, value;

Review Comment:
   `sort_key` is not used?



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -191,6 +235,58 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+    uint64_t found = 0;
+    int max_fetch_count = 100;
+    int max_fetch_size = 1000000;
+
+    for (int i = 0; i < FLAGS_benchmark_num / 100; i++) {
+
+        // generate hash key
+        std::string hashkey, sort_key, value;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+        std::set<std::string> sortkeys;
+
+        // generate sort key
+        // generate value for random to keep in peace with write
+        for (int j = 0; j < 100; j++) {
+            sortkeys.insert(generate_string(FLAGS_sortkey_size));
+            value = generate_string(FLAGS_value_size);
+        }
+
+        // read from pegasus
+        int try_count = 0;
+        while (true) {
+            try_count++;
+            int ret = _client->multi_get(
+                hashkey, sortkeys, kvs, max_fetch_count, max_fetch_size, FLAGS_pegasus_timeout_ms);
+            if (ret == ::pegasus::PERR_OK) {
+                found += 100;
+                bytes += (FLAGS_hashkey_size + FLAGS_sortkey_size + FLAGS_value_size) * 100;
+                break;
+            } else if (ret == ::pegasus::PERR_NOT_FOUND) {
+                break;
+            } else if (ret != ::pegasus::PERR_TIMEOUT || try_count > 3) {
+                fmt::print(stderr, "Get returned an error: {}\n", _client->get_error_string(ret));
+                dsn_exit(1);
+            } else {
+                fmt::print(stderr, "Get timeout, retry({})\n", try_count);
+            }
+        }
+
+        // count this operation
+        thread->stats.finished_ops(1, kRead);

Review Comment:
   Should be `kMultiGet`?



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -191,6 +235,58 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+    uint64_t found = 0;
+    int max_fetch_count = 100;
+    int max_fetch_size = 1000000;
+
+    for (int i = 0; i < FLAGS_benchmark_num / 100; i++) {
+

Review Comment:
   remove the blank line.



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -191,6 +235,58 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)

Review Comment:
   IMO, nothing is immutable, you can introduce more flags for the new tests.



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -191,6 +235,58 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+    uint64_t found = 0;
+    int max_fetch_count = 100;
+    int max_fetch_size = 1000000;
+
+    for (int i = 0; i < FLAGS_benchmark_num / 100; i++) {
+
+        // generate hash key
+        std::string hashkey, sort_key, value;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+        std::set<std::string> sortkeys;
+
+        // generate sort key
+        // generate value for random to keep in peace with write
+        for (int j = 0; j < 100; j++) {
+            sortkeys.insert(generate_string(FLAGS_sortkey_size));
+            value = generate_string(FLAGS_value_size);

Review Comment:
   why overwrite `value` repetitive?



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -152,6 +154,48 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    // do write operation num times

Review Comment:
   what does `num` mean?



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -191,6 +235,58 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+    uint64_t found = 0;
+    int max_fetch_count = 100;
+    int max_fetch_size = 1000000;
+
+    for (int i = 0; i < FLAGS_benchmark_num / 100; i++) {
+
+        // generate hash key
+        std::string hashkey, sort_key, value;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+        std::set<std::string> sortkeys;
+
+        // generate sort key
+        // generate value for random to keep in peace with write
+        for (int j = 0; j < 100; j++) {
+            sortkeys.insert(generate_string(FLAGS_sortkey_size));
+            value = generate_string(FLAGS_value_size);
+        }
+
+        // read from pegasus
+        int try_count = 0;
+        while (true) {
+            try_count++;
+            int ret = _client->multi_get(
+                hashkey, sortkeys, kvs, max_fetch_count, max_fetch_size, FLAGS_pegasus_timeout_ms);
+            if (ret == ::pegasus::PERR_OK) {
+                found += 100;
+                bytes += (FLAGS_hashkey_size + FLAGS_sortkey_size + FLAGS_value_size) * 100;

Review Comment:
   The returned count and bytes depends on `kvs`, not the FLAGS_*, suppose the case when the database is empty or filled by different flags.



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


[GitHub] [incubator-pegasus] Smityz commented on a diff in pull request #1373: refactor(test): add bench type multi set/get

Posted by "Smityz (via GitHub)" <gi...@apache.org>.
Smityz commented on code in PR #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373#discussion_r1119906452


##########
src/test/bench_test/benchmark.cpp:
##########
@@ -191,6 +235,58 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)

Review Comment:
   Can we set the distribution of the dataset?
   
   
   



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


[GitHub] [incubator-pegasus] GehaFearless commented on a diff in pull request #1373: feat(test): add bench type multi set/get

Posted by "GehaFearless (via GitHub)" <gi...@apache.org>.
GehaFearless commented on code in PR #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373#discussion_r1121066156


##########
run.sh:
##########
@@ -1399,6 +1399,8 @@ function usage_bench()
     echo "                             fillrandom_pegasus       --pegasus write N random values with random keys list"
     echo "                             readrandom_pegasus       --pegasus read N times with random keys list"
     echo "                             deleterandom_pegasus     --pegasus delete N entries with random keys list"
+    echo "                             multisetrandom_pegasus   --pegasus write (N/100)*100 random values with N/100 random keys list"

Review Comment:
   write 100 values with the same hashkey,so N should be a multiple of 100.
   
   `for (int i = 0; i < FLAGS_benchmark_num / 100; i++) `



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -152,6 +154,48 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    // do write operation num times

Review Comment:
   `--num <num>               number of key/value pairs, default is 10000"`



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -191,6 +235,58 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+    uint64_t found = 0;
+    int max_fetch_count = 100;
+    int max_fetch_size = 1000000;
+
+    for (int i = 0; i < FLAGS_benchmark_num / 100; i++) {
+
+        // generate hash key
+        std::string hashkey, sort_key, value;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+        std::set<std::string> sortkeys;
+
+        // generate sort key
+        // generate value for random to keep in peace with write
+        for (int j = 0; j < 100; j++) {
+            sortkeys.insert(generate_string(FLAGS_sortkey_size));
+            value = generate_string(FLAGS_value_size);

Review Comment:
   Cos `generate_string` should be ordered make data.
   
   Be like `generate_kv_pair` for `read_random`.



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


[GitHub] [incubator-pegasus] acelyc111 commented on a diff in pull request #1373: feat(test): add bench type multi set/get

Posted by "acelyc111 (via GitHub)" <gi...@apache.org>.
acelyc111 commented on code in PR #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373#discussion_r1121332357


##########
src/test/bench_test/benchmark.cpp:
##########
@@ -152,6 +155,57 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    if (FLAGS_benchmark_num % FLAGS_multi_count != 0) {

Review Comment:
   Use `DSN_DEFINE_group_validator` to check flags.



##########
src/test/bench_test/config.cpp:
##########
@@ -33,6 +33,7 @@ DSN_DEFINE_int32(pegasus.benchmark, threads, 1, "Number of concurrent threads to
 DSN_DEFINE_int32(pegasus.benchmark, hashkey_size, 16, "size of each hashkey");
 DSN_DEFINE_int32(pegasus.benchmark, sortkey_size, 16, "size of each sortkey");
 DSN_DEFINE_int32(pegasus.benchmark, value_size, 100, "Size of each value");
+DSN_DEFINE_int32(pegasus.benchmark, multi_count, 100, "Values count of the same hashkey");

Review Comment:
   Could you plz move all the configs (all DSN_DEFINE_*) to file `src/test/bench_test/benchmark.cpp`, where is closer to the place use them?



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -152,6 +155,57 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    if (FLAGS_benchmark_num % FLAGS_multi_count != 0) {
+        fmt::print(stderr,
+                   "num {} should be a multiple of multi_count({}).\n",
+                   FLAGS_benchmark_num,
+                   FLAGS_multi_count);
+        dsn_exit(1);
+    }
+
+    // do write operation num times
+    uint64_t bytes = 0;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // generate hash key
+        std::string hash_key, sort_key, value;
+        hash_key = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+
+        // generate sort key and value
+        for (int j = 0; j < FLAGS_multi_count; j++) {
+            sort_key = generate_string(FLAGS_sortkey_size);
+            value = generate_string(FLAGS_value_size);
+            kvs.emplace(sort_key, value);
+        }
+
+        // write to pegasus
+        int try_count = 0;
+        while (true) {
+            try_count++;
+            int ret = _client->multi_set(hash_key, kvs, FLAGS_pegasus_timeout_ms);
+            if (ret == ::pegasus::PERR_OK) {
+                bytes += (FLAGS_value_size + FLAGS_hashkey_size + FLAGS_sortkey_size) *
+                         FLAGS_multi_count;
+                break;
+            } else if (ret != ::pegasus::PERR_TIMEOUT || try_count > 3) {
+                fmt::print(stderr, "Set returned an error: {}\n", _client->get_error_string(ret));
+                dsn_exit(1);
+            } else {

Review Comment:
   Then
   ```suggestion
               }
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -152,6 +155,57 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    if (FLAGS_benchmark_num % FLAGS_multi_count != 0) {
+        fmt::print(stderr,
+                   "num {} should be a multiple of multi_count({}).\n",
+                   FLAGS_benchmark_num,
+                   FLAGS_multi_count);
+        dsn_exit(1);
+    }
+
+    // do write operation num times

Review Comment:
   For comments, it's recommend to use upper case for the leading letter, and ended by a dot.



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -191,6 +235,58 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)
+{
+    uint64_t bytes = 0;
+    uint64_t found = 0;
+    int max_fetch_count = 100;
+    int max_fetch_size = 1000000;
+
+    for (int i = 0; i < FLAGS_benchmark_num / 100; i++) {
+
+        // generate hash key
+        std::string hashkey, sort_key, value;
+        hashkey = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+        std::set<std::string> sortkeys;
+
+        // generate sort key
+        // generate value for random to keep in peace with write
+        for (int j = 0; j < 100; j++) {
+            sortkeys.insert(generate_string(FLAGS_sortkey_size));
+            value = generate_string(FLAGS_value_size);

Review Comment:
   Invoke `generate_string` is enough, not need to assign, and add some comments.
   
   PS: A better way is to separate the generator function of keys and values.



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -152,6 +155,57 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    if (FLAGS_benchmark_num % FLAGS_multi_count != 0) {
+        fmt::print(stderr,
+                   "num {} should be a multiple of multi_count({}).\n",
+                   FLAGS_benchmark_num,
+                   FLAGS_multi_count);
+        dsn_exit(1);
+    }
+
+    // do write operation num times
+    uint64_t bytes = 0;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // generate hash key
+        std::string hash_key, sort_key, value;
+        hash_key = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+
+        // generate sort key and value
+        for (int j = 0; j < FLAGS_multi_count; j++) {
+            sort_key = generate_string(FLAGS_sortkey_size);
+            value = generate_string(FLAGS_value_size);
+            kvs.emplace(sort_key, value);
+        }
+
+        // write to pegasus
+        int try_count = 0;
+        while (true) {
+            try_count++;
+            int ret = _client->multi_set(hash_key, kvs, FLAGS_pegasus_timeout_ms);
+            if (ret == ::pegasus::PERR_OK) {
+                bytes += (FLAGS_value_size + FLAGS_hashkey_size + FLAGS_sortkey_size) *
+                         FLAGS_multi_count;
+                break;
+            } else if (ret != ::pegasus::PERR_TIMEOUT || try_count > 3) {
+                fmt::print(stderr, "Set returned an error: {}\n", _client->get_error_string(ret));
+                dsn_exit(1);
+            } else {

Review Comment:
   The same to multi_get_random.



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -152,6 +155,57 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    if (FLAGS_benchmark_num % FLAGS_multi_count != 0) {
+        fmt::print(stderr,
+                   "num {} should be a multiple of multi_count({}).\n",
+                   FLAGS_benchmark_num,
+                   FLAGS_multi_count);
+        dsn_exit(1);
+    }
+
+    // do write operation num times
+    uint64_t bytes = 0;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // generate hash key
+        std::string hash_key, sort_key, value;
+        hash_key = generate_string(FLAGS_hashkey_size);
+        std::map<std::string, std::string> kvs;
+
+        // generate sort key and value
+        for (int j = 0; j < FLAGS_multi_count; j++) {
+            sort_key = generate_string(FLAGS_sortkey_size);
+            value = generate_string(FLAGS_value_size);
+            kvs.emplace(sort_key, value);
+        }
+
+        // write to pegasus
+        int try_count = 0;
+        while (true) {
+            try_count++;
+            int ret = _client->multi_set(hash_key, kvs, FLAGS_pegasus_timeout_ms);
+            if (ret == ::pegasus::PERR_OK) {
+                bytes += (FLAGS_value_size + FLAGS_hashkey_size + FLAGS_sortkey_size) *
+                         FLAGS_multi_count;
+                break;
+            } else if (ret != ::pegasus::PERR_TIMEOUT || try_count > 3) {

Review Comment:
   ```suggestion
               }
               if (ret != ::pegasus::PERR_TIMEOUT || try_count > 3) {
   ```



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -152,6 +155,57 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    if (FLAGS_benchmark_num % FLAGS_multi_count != 0) {
+        fmt::print(stderr,
+                   "num {} should be a multiple of multi_count({}).\n",
+                   FLAGS_benchmark_num,
+                   FLAGS_multi_count);
+        dsn_exit(1);
+    }
+
+    // do write operation num times
+    uint64_t bytes = 0;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // generate hash key
+        std::string hash_key, sort_key, value;
+        hash_key = generate_string(FLAGS_hashkey_size);

Review Comment:
   Define and assign hash_key in one line.
   `sort_key` and `value` are not needed to declare here, you can emplace the generated strings to kvs directly, i.e. `kvs.emplace(generate_string(...), generate_string(...));`.



##########
src/test/bench_test/benchmark.cpp:
##########
@@ -152,6 +154,48 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    // do write operation num times

Review Comment:
   Use `FLAGS_benchmark_num` to replace it.



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


[GitHub] [incubator-pegasus] acelyc111 commented on a diff in pull request #1373: refactor(test): add bench type multi set/get

Posted by "acelyc111 (via GitHub)" <gi...@apache.org>.
acelyc111 commented on code in PR #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373#discussion_r1121221826


##########
src/test/bench_test/benchmark.cpp:
##########
@@ -191,6 +235,58 @@ void benchmark::read_random(thread_arg *thread)
     thread->stats.add_message(msg);
 }
 
+void benchmark::multi_get_random(thread_arg *thread)

Review Comment:
   It depends on `generate_string`, I think it's a very low rate currently. We can reuse the seed which is used for random to control the rate.



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


[GitHub] [incubator-pegasus] acelyc111 merged pull request #1373: feat(test): add bench type multi set/get

Posted by "acelyc111 (via GitHub)" <gi...@apache.org>.
acelyc111 merged PR #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373


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


[GitHub] [incubator-pegasus] GehaFearless commented on a diff in pull request #1373: feat(test): add bench type multi set/get

Posted by "GehaFearless (via GitHub)" <gi...@apache.org>.
GehaFearless commented on code in PR #1373:
URL: https://github.com/apache/incubator-pegasus/pull/1373#discussion_r1121730582


##########
src/test/bench_test/benchmark.cpp:
##########
@@ -152,6 +155,57 @@ void benchmark::write_random(thread_arg *thread)
     thread->stats.add_bytes(bytes);
 }
 
+void benchmark::multi_set_random(thread_arg *thread)
+{
+    if (FLAGS_benchmark_num % FLAGS_multi_count != 0) {
+        fmt::print(stderr,
+                   "num {} should be a multiple of multi_count({}).\n",
+                   FLAGS_benchmark_num,
+                   FLAGS_multi_count);
+        dsn_exit(1);
+    }
+
+    // do write operation num times
+    uint64_t bytes = 0;
+
+    for (int i = 0; i < FLAGS_benchmark_num / FLAGS_multi_count; i++) {
+        // generate hash key
+        std::string hash_key, sort_key, value;
+        hash_key = generate_string(FLAGS_hashkey_size);

Review Comment:
   It will make trouble.The argument list is built from right to left.So I need the 2 temporary variable.



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