1
0
mirror of https://github.com/redis/node-redis.git synced 2025-12-12 21:21:15 +03:00

feat: add LATENCY_RESET command (#3047)

This commit is contained in:
blackman
2025-08-27 18:10:15 +03:00
committed by GitHub
parent 672246dbd2
commit 1d824df9e1
3 changed files with 131 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
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;