You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
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 <q.rankin@outlook.com> Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
This commit is contained in:
@@ -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,
|
||||
@@ -193,6 +194,8 @@ export default {
|
||||
keys: KEYS,
|
||||
LASTSAVE,
|
||||
lastSave: LASTSAVE,
|
||||
LATENCY_DOCTOR,
|
||||
latencyDoctor: LATENCY_DOCTOR,
|
||||
LOLWUT,
|
||||
lolwut: LOLWUT,
|
||||
MEMOERY_DOCTOR,
|
||||
|
19
packages/client/lib/commands/LATENCY_DOCTOR.spec.ts
Normal file
19
packages/client/lib/commands/LATENCY_DOCTOR.spec.ts
Normal file
@@ -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
packages/client/lib/commands/LATENCY_DOCTOR.ts
Normal file
5
packages/client/lib/commands/LATENCY_DOCTOR.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export function transformArguments(): Array<string> {
|
||||
return ['LATENCY', 'DOCTOR'];
|
||||
}
|
||||
|
||||
export declare function transformReply(): string;
|
Reference in New Issue
Block a user