You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
21 lines
539 B
TypeScript
21 lines
539 B
TypeScript
import { NumberReply, NullReply, Command, RedisArgument } from '../RESP/types';
|
|
|
|
export interface MemoryUsageOptions {
|
|
SAMPLES?: number;
|
|
}
|
|
|
|
export default {
|
|
FIRST_KEY_INDEX: 1,
|
|
IS_READ_ONLY: true,
|
|
transformArguments(key: RedisArgument, options?: MemoryUsageOptions) {
|
|
const args = ['MEMORY', 'USAGE', key];
|
|
|
|
if (options?.SAMPLES) {
|
|
args.push('SAMPLES', options.SAMPLES.toString());
|
|
}
|
|
|
|
return args;
|
|
},
|
|
transformReply: undefined as unknown as () => NumberReply | NullReply
|
|
} as const satisfies Command;
|