2016-08-18 12 views

答えて

0

よく私はnodejsで& ExpressをRedisのAPIを使用して、ここだけのJMeter

をテストを実施することは、私のコード

var express = require('express'); 
var app = express(); 

var redis = require("redis"), 
client = redis.createClient(6379,"10.96.82.175"); 

app.get('/', function (req, res) { 


      res.send("HEY Nodejs runnning on 10.96.82.175:4000"); 

}); 
app.put('/set/:arg1/:arg2', function (req, res) { 

     client.set(req.params.arg1,req.params.arg2,function (err, reply) { 
     if (reply==null) 
     { 
      res.send("null"); 
     } 
     else { 
      res.send(reply.toString()); 
     } 

     }); 
}); 


app.get('/get/:arg1', function (req, res) { 
     client.get(req.params.arg1,function (err, reply) { 

     if (reply==null) 
     { 
      res.send("null"); 
     } 
     else { 
      res.send(reply.toString()); 
     } 

     }); 
}); 






app.get('/incr/:arg1', function (req, res) { 
     client.incr(req.params.arg1, function (err, reply) { 
     if (reply==null) 
     { 
      res.send("null"); 
     } 
     else { 
      res.send(reply.toString()); 
     } 

      //console.log(reply.toString()); 
     }); 
}); 





app.put('/lpush/:arg1/:arg2', function (req, res) { 
    client.lpush(req.params.arg1,req.params.arg2, function (err, reply) { 
    if (reply==null) 
    { 
     res.send("null"); 
    } 
    else { 
     res.send(reply.toString()); 
    } 

      //console.log(reply.toString()); 
     }); 
}); 



app.get('/lpop/:arg1', function (req, res) { 
    client.lpop(req.params.arg1, function (err, reply) { 

    if (reply==null) 
    { 
     res.send("null"); 
    } 
    else { 
     res.send(reply.toString()); 
    } 
     }); 
}); 



app.put('/sadd/:arg1/:arg2', function (req, res) { 
    client.sadd(req.params.arg1,req.params.arg2, function (err, reply) { 
    if (reply==null) 
    { 
     res.send("null"); 
    } 
    else { 
     res.send(reply.toString()); 
    } 
      //console.log(reply.toString()); 
     }); 
}); 




app.get('/spop/:arg1', function (req, res) { 
    client.spop(req.params.arg1,1, function (err, reply) { 

    if (reply==null) 
    { 
     res.send("null"); 
    } 
    else { 
     res.send(reply.toString()); 
    } 
      //console.log(reply.toString()); 
     }); 
}); 


app.put('/zadd/:arg1/:arg2/:arg3', function (req, res) { 
    client.zadd(req.params.arg1,req.params.arg2,req.params.arg3,function (err, reply) { 
    if (reply==null) 
    { 
     res.send("null"); 
    } 
    else { 
     res.send(reply.toString()); 
    } 
      //console.log(reply.toString()); 
     }); 
}); 





app.put('/hset/:arg1/:arg2/:arg3', function (req, res) { 
     client.hset(req.params.arg1,req.params.arg2,req.params.arg3,function (err, reply) { 
     if (reply==null) 
     { 
      res.send("null"); 
     } 
     else { 
      res.send(reply.toString()); 
     } 
      //console.log(reply.toString()); 
     }); 
}); 




app.get('/hget/:arg1/:arg2', function (req, res) { 

     client.hget(req.params.arg1,req.params.arg2,function (err, reply) { 

     if (reply==null) 
     { 
      res.send("null"); 
     } 
     else { 
      res.send(reply.toString()); 
     } 
      //console.log(reply); 
     }); 
}); 





app.listen(4000, function() { 

    console.log('Example app listening on port 4000!'); 
}); 

、ここでは私のJMXファイルは

JMX FILE LINK

です
関連する問題