You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
update benchmarks
This commit is contained in:
@@ -1,19 +1,23 @@
|
||||
import Redis from 'ioredis';
|
||||
|
||||
const client = new Redis({ lazyConnect: true });
|
||||
export default async (host, { randomString }) => {
|
||||
const client = new Redis({
|
||||
host,
|
||||
lazyConnect: true
|
||||
});
|
||||
|
||||
export function setup() {
|
||||
return client.connect();
|
||||
}
|
||||
await client.connect();
|
||||
|
||||
export function benchmark({ randomString }) {
|
||||
return Promise.all([
|
||||
client.set(randomString, randomString),
|
||||
client.get(randomString),
|
||||
client.del(randomString)
|
||||
]);
|
||||
}
|
||||
|
||||
export function teardown() {
|
||||
return client.disconnect();
|
||||
}
|
||||
return {
|
||||
benchmark() {
|
||||
return Promise.all([
|
||||
client.set(randomString, randomString),
|
||||
client.get(randomString),
|
||||
client.del(randomString)
|
||||
]);
|
||||
},
|
||||
teardown() {
|
||||
return client.disconnect();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user