Skip to content

Commit 14741bf

Browse files
authored
Merge 26ad2ed into 67d9c3c
2 parents 67d9c3c + 26ad2ed commit 14741bf

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-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 KEYS from '../commands/KEYS';
8484
import * as LASTSAVE from '../commands/LASTSAVE';
8585
import * as LATENCY_DOCTOR from '../commands/LATENCY_DOCTOR';
8686
import * as LATENCY_GRAPH from '../commands/LATENCY_GRAPH';
87+
import * as LATENCY_LATEST from '../commands/LATENCY_LATEST';
8788
import * as LOLWUT from '../commands/LOLWUT';
8889
import * as MEMORY_DOCTOR from '../commands/MEMORY_DOCTOR';
8990
import * as MEMORY_MALLOC_STATS from '../commands/MEMORY_MALLOC-STATS';
@@ -290,6 +291,8 @@ export default {
290291
latencyDoctor: LATENCY_DOCTOR,
291292
LATENCY_GRAPH,
292293
latencyGraph: LATENCY_GRAPH,
294+
LATENCY_LATEST,
295+
latencyLatest: LATENCY_LATEST,
293296
LOLWUT,
294297
lolwut: LOLWUT,
295298
MEMORY_DOCTOR,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import {strict as assert} from 'assert';
2+
import testUtils, {GLOBAL} from '../test-utils';
3+
import { transformArguments } from './LATENCY_LATEST';
4+
5+
describe('LATENCY LATEST', () => {
6+
it('transformArguments', () => {
7+
assert.deepEqual(
8+
transformArguments(),
9+
['LATENCY', 'LATEST']
10+
);
11+
});
12+
13+
testUtils.testWithClient('client.latencyLatest', async client => {
14+
const latency = await client.latencyLatest();
15+
const latencyType = Array.isArray(latency);
16+
assert.strictEqual(latencyType, true);
17+
}, GLOBAL.SERVERS.OPEN);
18+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { RedisCommandArguments } from '.';
2+
3+
export interface latenctStats{
4+
event : string,
5+
timestamp: number,
6+
latestLatency: number,
7+
allTimeLatency: number
8+
}
9+
10+
export function transformArguments(): RedisCommandArguments {
11+
return ['LATENCY', 'LATEST'];
12+
}
13+
14+
export declare function transformReply(): Array<latenctStats>;

0 commit comments

Comments
 (0)