Skip to content

Commit 6ca45f6

Browse files
QuentinRKleibale
andauthored
support command LATENCY DOCTOR (#2053)
* The Latency Doctor Command has been added to the project * Update LATENCY_DOCTOR.ts * Update LATENCY_DOCTOR.spec.ts * Update LATENCY_DOCTOR.spec.ts Co-authored-by: QuentinRK <[email protected]> Co-authored-by: Leibale Eidelman <[email protected]>
1 parent 6b8a40a commit 6ca45f6

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

packages/client/lib/client/commands.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ import * as SWAPDB from '../commands/SWAPDB';
8484
import * as TIME from '../commands/TIME';
8585
import * as UNWATCH from '../commands/UNWATCH';
8686
import * as WAIT from '../commands/WAIT';
87+
import * as LATENCY_DOCTOR from '../commands/LATENCY_DOCTOR';
8788

8889
export default {
8990
...CLUSTER_COMMANDS,
@@ -193,6 +194,8 @@ export default {
193194
keys: KEYS,
194195
LASTSAVE,
195196
lastSave: LASTSAVE,
197+
LATENCY_DOCTOR,
198+
latencyDoctor: LATENCY_DOCTOR,
196199
LOLWUT,
197200
lolwut: LOLWUT,
198201
MEMOERY_DOCTOR,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import {strict as assert} from 'assert';
2+
import testUtils, {GLOBAL} from '../test-utils';
3+
import { transformArguments } from './LATENCY_DOCTOR';
4+
5+
describe('LATENCY DOCTOR', () => {
6+
it('transformArguments', () => {
7+
assert.deepEqual(
8+
transformArguments(),
9+
['LATENCY', 'DOCTOR']
10+
);
11+
});
12+
13+
testUtils.testWithClient('client.latencyDoctor', async client => {
14+
assert.equal(
15+
typeof (await client.latencyDoctor()),
16+
'string'
17+
);
18+
}, GLOBAL.SERVERS.OPEN);
19+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export function transformArguments(): Array<string> {
2+
return ['LATENCY', 'DOCTOR'];
3+
}
4+
5+
export declare function transformReply(): string;

0 commit comments

Comments
 (0)