You've already forked node-redis
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:
24
packages/client/lib/commands/LATENCY_RESET.ts
Normal file
24
packages/client/lib/commands/LATENCY_RESET.ts
Normal 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;
|
||||
Reference in New Issue
Block a user