Skip to content

Commit a5c9c51

Browse files
author
tomsongrany
committed
Updated latency reset
1 parent 5bbd576 commit a5c9c51

File tree

1 file changed

+20
-27
lines changed

1 file changed

+20
-27
lines changed
Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,24 @@
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';
54

65
export { LATENCY_EVENTS, LatencyEvent };
76

8-
// This object defines the LATENCY RESET command's behavior for the Redis client.
97
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

Comments
 (0)