Browse Source

[silicon] Fix queries parameter handler. Fix lwan install script.

Matthieu Garrigues 9 years ago
parent
commit
4514ea1ccb
2 changed files with 6 additions and 5 deletions
  1. 4 4
      frameworks/C++/silicon/techempower.hh
  2. 2 1
      toolset/setup/linux/frameworks/lwan.sh

+ 4 - 4
frameworks/C++/silicon/techempower.hh

@@ -55,8 +55,8 @@ auto techempower_api = http_api(
                     _body = r);
                     _body = r);
   },
   },
 
 
-  GET / _queries * get_parameters(_queries = int()) = [] (auto param, rn_orm& orm) {
-    int N = param.queries;
+  GET / _queries * get_parameters(_queries = optional(std::string("1"))) = [] (auto param, rn_orm& orm) {
+    int N = atoi(param.queries.c_str());
     N = std::max(1, std::min(N, 500));
     N = std::max(1, std::min(N, 500));
 
 
     std::vector<random_number> qs(N);
     std::vector<random_number> qs(N);
@@ -66,8 +66,8 @@ auto techempower_api = http_api(
                     _body = std::move(qs));
                     _body = std::move(qs));
   },
   },
 
 
-  GET / _updates * get_parameters(_queries = int()) = [] (auto param, rn_orm& orm) {
-    int N = param.queries;
+  GET / _updates * get_parameters(_queries = optional(std::string("1"))) = [] (auto param, rn_orm& orm) {
+    int N = atoi(param.queries.c_str());
     N = std::max(1, std::min(N, 500));
     N = std::max(1, std::min(N, 500));
 
 
     std::vector<random_number> qs(N);
     std::vector<random_number> qs(N);

+ 2 - 1
toolset/setup/linux/frameworks/lwan.sh

@@ -17,8 +17,9 @@ cd $LWAN_HOME
 git checkout ${REV}
 git checkout ${REV}
 mkdir build
 mkdir build
 cd build
 cd build
-cmake .. -DCMAKE_BUILD_TYPE=Release
+cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$IROOT
 make techempower
 make techempower
+make install
 
 
 echo "export LWAN_ROOT=${LWAN_HOME}" > $IROOT/lwan.installed
 echo "export LWAN_ROOT=${LWAN_HOME}" > $IROOT/lwan.installed
 echo -e "export LWAN_BUILD=\$LWAN_ROOT/build" >> $IROOT/lwan.installed
 echo -e "export LWAN_BUILD=\$LWAN_ROOT/build" >> $IROOT/lwan.installed