You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-12-11 09:22:35 +03:00
25 lines
836 B
TypeScript
25 lines
836 B
TypeScript
import { CommandParser } from '../client/parser';
|
|
import { Command } from '../RESP/types';
|
|
import { LATENCY_EVENTS, LatencyEvent } from './LATENCY_GRAPH';
|
|
|
|
export { LATENCY_EVENTS, LatencyEvent };
|
|
|
|
export default {
|
|
NOT_KEYED_COMMAND: true,
|
|
IS_READ_ONLY: false,
|
|
/**
|
|
* Constructs the LATENCY RESET command
|
|
* * @param parser - The command parser
|
|
* @param events - The latency events to reset. If not specified, all events are reset.
|
|
* @see https://redis.io/commands/latency-reset/
|
|
*/
|
|
parseCommand(parser: CommandParser, ...events: Array<LatencyEvent>) {
|
|
const args = ['LATENCY', 'RESET'];
|
|
if (events.length > 0) {
|
|
args.push(...events);
|
|
}
|
|
parser.push(...args);
|
|
},
|
|
transformReply: undefined as unknown as () => number
|
|
} as const satisfies Command;
|