Przeglądaj źródła

Lithum: multithreaded update test. (#5945)

Matthieu Garrigues 5 lat temu
rodzic
commit
a93ac9f868

+ 1 - 0
frameworks/C++/lithium/benchmark_config.json

@@ -54,6 +54,7 @@
         "db_url"         : "/db",
         "query_url"      : "/queries?N=",
         "fortune_url"    : "/fortunes",
+        "update_url"     : "/updates?N=",
         "port": 8080,
         "approach": "Realistic",
         "classification": "Micro",

+ 3 - 1
frameworks/C++/lithium/lithium_pipeline.cc

@@ -122,7 +122,9 @@ int main(int argc, char* argv[]) {
     for (int i = 0; i < N; i++)
       numbers[i].randomNumber = 1 + rand() % 10000;
 
-    c.bulk_update(numbers).flush_results();
+    auto req = c.bulk_update(numbers);
+    if (N_SQL_CONNECTIONS * nthreads > 1) c.backend_connection().end_of_batch();
+    req.flush_results();
     response.write_json(numbers);
   };