Skip to content

Commit

Permalink
support command LATENCY DOCTOR (#2053)
Browse files Browse the repository at this point in the history
* 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 <q.rankin@outlook.com>
Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
  • Loading branch information
3 people authored Mar 27, 2022
1 parent 6b8a40a commit 6ca45f6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/client/lib/client/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import * as SWAPDB from '../commands/SWAPDB';
import * as TIME from '../commands/TIME';
import * as UNWATCH from '../commands/UNWATCH';
import * as WAIT from '../commands/WAIT';
import * as LATENCY_DOCTOR from '../commands/LATENCY_DOCTOR';

export default {
...CLUSTER_COMMANDS,
Expand Down Expand Up @@ -193,6 +194,8 @@ export default {
keys: KEYS,
LASTSAVE,
lastSave: LASTSAVE,
LATENCY_DOCTOR,
latencyDoctor: LATENCY_DOCTOR,
LOLWUT,
lolwut: LOLWUT,
MEMOERY_DOCTOR,
Expand Down
19 changes: 19 additions & 0 deletions packages/client/lib/commands/LATENCY_DOCTOR.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {strict as assert} from 'assert';
import testUtils, {GLOBAL} from '../test-utils';
import { transformArguments } from './LATENCY_DOCTOR';

describe('LATENCY DOCTOR', () => {
it('transformArguments', () => {
assert.deepEqual(
transformArguments(),
['LATENCY', 'DOCTOR']
);
});

testUtils.testWithClient('client.latencyDoctor', async client => {
assert.equal(
typeof (await client.latencyDoctor()),
'string'
);
}, GLOBAL.SERVERS.OPEN);
});
5 changes: 5 additions & 0 deletions packages/client/lib/commands/LATENCY_DOCTOR.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export function transformArguments(): Array<string> {
return ['LATENCY', 'DOCTOR'];
}

export declare function transformReply(): string;

0 comments on commit 6ca45f6

Please sign in to comment.