You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
28 lines
475 B
JavaScript
28 lines
475 B
JavaScript
import { createClient } from 'redis-local';
|
|
import PING from 'redis-local/dist/lib/commands/PING.js';
|
|
|
|
export default async (host) => {
|
|
const client = createClient({
|
|
socket: {
|
|
host
|
|
},
|
|
RESP: 3,
|
|
modules: {
|
|
module: {
|
|
ping: PING.default
|
|
}
|
|
}
|
|
});
|
|
|
|
await client.connect();
|
|
|
|
return {
|
|
benchmark() {
|
|
return client.withTypeMapping({}).module.ping();
|
|
},
|
|
teardown() {
|
|
return client.disconnect();
|
|
}
|
|
};
|
|
};
|