Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support command LATENCY DOCTOR #2053

Merged
merged 4 commits into from
Mar 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/client/lib/client/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,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 @@ -184,6 +185,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;