Browse Source

Fix express mysql (#4464)

* added Python vibora -- certain issues with the framework only allow for 3 tests currently

* changed updateworld to fetch a random world before updating it

* fixed update routes for all perfect permutations with updates

* WIP

* WIP

* WIP Dockerfile

* upgraded rust version and imported serde as the github said to

* removed muffin

* pippo json and plaintext

* added a 15 second delta to check for cached dates

* removed pippo entry

* added date check using sleep and a second request

* removed unnecessary import

* fixed warning for query_test on express
jenriquez-techempower 6 years ago
parent
commit
740a16879c

+ 1 - 1
frameworks/JavaScript/express/benchmark_config.json

@@ -50,7 +50,7 @@
     },
     },
     "mysql": {
     "mysql": {
       "db_url": "/mysql-orm",
       "db_url": "/mysql-orm",
-      "query_url": "/mysql-orm?queries=",
+      "query_url": "/mysql-orm-query?queries=",
       "fortune_url": "/mysql-orm-fortune",
       "fortune_url": "/mysql-orm-fortune",
       "update_url": "/mysql-orm-update?queries=",
       "update_url": "/mysql-orm-update?queries=",
       "port": 8080,
       "port": 8080,

+ 14 - 2
frameworks/JavaScript/express/mysql-app.js

@@ -68,7 +68,7 @@ if (cluster.isMaster) {
   app.set('views', __dirname + '/views');
   app.set('views', __dirname + '/views');
 
 
   // Routes
   // Routes
-  app.get('/mysql-orm', async (req, res) => {
+  app.get('/mysql-orm-query', async (req, res) => {
     const results = [],
     const results = [],
       queries = Math.min(parseInt(req.query.queries) || 1, 500);
       queries = Math.min(parseInt(req.query.queries) || 1, 500);
 
 
@@ -83,7 +83,19 @@ if (cluster.isMaster) {
     }
     }
 
 
     res.setHeader("Content-Type", "application/json");
     res.setHeader("Content-Type", "application/json");
-    res.send(results.length > 1 ? results : results[0]);
+    res.send(results);
+  });
+
+  app.get('/mysql-orm', async (req, res) => {
+    const world = await World.findOne({
+      where: {
+        id: Math.floor(Math.random() * 10000) + 1
+      }
+    }
+    );
+
+    res.setHeader("Content-Type", "application/json");
+    res.send(world)
   });
   });
 
 
   app.get('/mysql-orm-fortune', (req, res) => {
   app.get('/mysql-orm-fortune', (req, res) => {