|
1 |
| -import { CommandParser } from '../client/parser'; |
2 |
| -import { Command } from '../RESP/types'; |
3 |
| -import { LATENCY_EVENTS, LatencyEvent } from './LATENCY_GRAPH'; |
4 |
| - |
| 1 | +import { CommandParser } from '../client/parser'; |
| 2 | +import { Command } from '../RESP/types'; |
| 3 | +import { LATENCY_EVENTS, LatencyEvent } from './LATENCY_GRAPH'; |
5 | 4 |
|
6 | 5 | export { LATENCY_EVENTS, LatencyEvent };
|
7 | 6 |
|
8 |
| -// This object defines the LATENCY RESET command's behavior for the Redis client. |
9 | 7 | export default {
|
10 |
| - |
11 |
| - NOT_KEYED_COMMAND: true, |
12 |
| - |
13 |
| - |
14 |
| - IS_READ_ONLY: false, |
15 |
| - |
16 |
| - |
17 |
| - parseCommand(parser: CommandParser, ...events: Array<LatencyEvent>) { |
18 |
| - |
19 |
| - const args: Array<string> = ['LATENCY', 'RESET']; |
20 |
| - |
21 |
| - |
22 |
| - if (events.length > 0) { |
23 |
| - args.push(...events); |
24 |
| - } |
25 |
| - |
26 |
| - |
27 |
| - parser.push(...args); |
28 |
| - }, |
29 |
| - |
30 |
| - transformReply: undefined as unknown as () => number |
31 |
| -} as const satisfies Command; |
| 8 | + NOT_KEYED_COMMAND: true, |
| 9 | + IS_READ_ONLY: false, |
| 10 | + /** |
| 11 | + * Constructs the LATENCY RESET command |
| 12 | + * * @param parser - The command parser |
| 13 | + * @param events - The latency events to reset. If not specified, all events are reset. |
| 14 | + * @see https://redis.io/commands/latency-reset/ |
| 15 | + */ |
| 16 | + parseCommand(parser: CommandParser, ...events: Array<LatencyEvent>) { |
| 17 | + const args = ['LATENCY', 'RESET']; |
| 18 | + if (events.length > 0) { |
| 19 | + args.push(...events); |
| 20 | + } |
| 21 | + parser.push(...args); |
| 22 | + }, |
| 23 | + transformReply: undefined as unknown as () => number |
| 24 | +} as const satisfies Command; |
0 commit comments