You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-03 04:01:40 +03:00
25 lines
535 B
JavaScript
25 lines
535 B
JavaScript
import { createClient } from '@node-redis/client';
|
|
|
|
export default async (host, { randomString }) => {
|
|
const client = createClient({
|
|
socket: {
|
|
host
|
|
}
|
|
});
|
|
|
|
await client.connect();
|
|
|
|
return {
|
|
benchmark() {
|
|
return Promise.all([
|
|
client.set(randomString, randomString),
|
|
client.get(randomString),
|
|
client.del(randomString)
|
|
]);
|
|
},
|
|
teardown() {
|
|
return client.disconnect();
|
|
}
|
|
};
|
|
};
|