wangle-bench gflags
authorHans Fugal <fugalh@fb.com>
Tue, 7 Oct 2014 22:50:32 +0000 (15:50 -0700)
committerAndrii Grynenko <andrii@fb.com>
Wed, 15 Oct 2014 00:55:45 +0000 (17:55 -0700)
Summary: Because windtunnel quirkloads needs `--json` which is enabled with gflags

Test Plan:
$ wangle-bench --json
{
"%hundredThens" : 28133155.113220215,
"no_contention" : 4842268655.11322,
"%fourThens" : 1495655.1132202148,
"%twoThens" : 882311.3632202148,
"oneThen" : 581053.5507202148,
"-" : 0,
"%withThen" : 559830.8944702148,
"%promiseAndFuture" : 250840.66009521484,
"%contention" : 8074419655.11322,
"constantFuture" : 239916.83197021484
}

Reviewed By: meisner@fb.com

Subscribers: robbert, net-systems@, fugalh, exa, njormrod, davejwatson, jsedgwick

FB internal diff: D1601364

Tasks: 5277907

folly/wangle/test/Benchmark.cpp

index d88d9b9d090904ca79cbaad087a0babfed7c4864..95fcef9f6e23ced29dedf684c248b50c1c86041e 100644 (file)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#include <gflags/gflags.h>
 #include <folly/Baton.h>
 #include <folly/Benchmark.h>
 #include <folly/wangle/Future.h>
@@ -24,6 +25,8 @@
 using namespace folly::wangle;
 using namespace std;
 
+namespace {
+
 template <class T>
 T incr(Try<T>&& t) {
   return t.value() + 1;
@@ -36,6 +39,8 @@ void someThens(size_t n) {
   }
 }
 
+} // anonymous namespace
+
 BENCHMARK(constantFuture) {
   makeFuture(42);
 }
@@ -160,6 +165,8 @@ BENCHMARK_RELATIVE(contention) {
   producer.join();
 }
 
-int main() {
+int main(int argc, char** argv) {
+  gflags::ParseCommandLineFlags(&argc, &argv, true);
   folly::runBenchmarks();
+  return 0;
 }