File tree Expand file tree Collapse file tree 3 files changed +61
-1
lines changed Expand file tree Collapse file tree 3 files changed +61
-1
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ import * as HELLO from '../commands/HELLO';
8181import * as INFO from '../commands/INFO' ;
8282import * as KEYS from '../commands/KEYS' ;
8383import * as LASTSAVE from '../commands/LASTSAVE' ;
84+ import * as LATENCY_DOCTOR from '../commands/LATENCY_DOCTOR' ;
85+ import * as LATENCY_GRAPH from '../commands/LATENCY_GRAPH' ;
8486import * as LOLWUT from '../commands/LOLWUT' ;
8587import * as MEMORY_DOCTOR from '../commands/MEMORY_DOCTOR' ;
8688import * as MEMORY_MALLOC_STATS from '../commands/MEMORY_MALLOC-STATS' ;
@@ -113,7 +115,6 @@ import * as SWAPDB from '../commands/SWAPDB';
113115import * as TIME from '../commands/TIME' ;
114116import * as UNWATCH from '../commands/UNWATCH' ;
115117import * as WAIT from '../commands/WAIT' ;
116- import * as LATENCY_DOCTOR from '../commands/LATENCY_DOCTOR' ;
117118
118119export default {
119120 ...CLUSTER_COMMANDS ,
@@ -283,6 +284,8 @@ export default {
283284 lastSave : LASTSAVE ,
284285 LATENCY_DOCTOR ,
285286 latencyDoctor : LATENCY_DOCTOR ,
287+ LATENCY_GRAPH ,
288+ latencyGraph : LATENCY_GRAPH ,
286289 LOLWUT ,
287290 lolwut : LOLWUT ,
288291 MEMORY_DOCTOR ,
Original file line number Diff line number Diff line change 1+ import { strict as assert } from 'assert' ;
2+ import testUtils , { GLOBAL } from '../test-utils' ;
3+ import { transformArguments } from './LATENCY_GRAPH' ;
4+
5+ describe ( 'LATENCY GRAPH' , ( ) => {
6+ it ( 'transformArguments' , ( ) => {
7+ assert . deepEqual (
8+ transformArguments ( 'command' ) ,
9+ [
10+ 'LATENCY' ,
11+ 'GRAPH' ,
12+ 'command'
13+ ]
14+ ) ;
15+ } ) ;
16+
17+ testUtils . testWithClient ( 'client.latencyGraph' , async client => {
18+ await Promise . all ( [
19+ client . configSet ( 'latency-monitor-threshold' , '1' ) ,
20+ client . sendCommand ( [ 'DEBUG' , 'SLEEP' , '0.001' ] )
21+ ] ) ;
22+
23+ assert . equal (
24+ typeof await client . latencyGraph ( 'command' ) ,
25+ 'string'
26+ ) ;
27+ } , {
28+ serverArguments : testUtils . isVersionGreaterThan ( [ 7 ] ) ?
29+ [ '--enable-debug-command' , 'yes' ] :
30+ GLOBAL . SERVERS . OPEN . serverArguments
31+ } ) ;
32+ } ) ;
Original file line number Diff line number Diff line change 1+ import { RedisCommandArguments } from '.' ;
2+
3+ export type EventType =
4+ 'active-defrag-cycle'
5+ | 'aof-fsync-always'
6+ | 'aof-stat'
7+ | 'aof-rewrite-diff-write'
8+ | 'aof-rename'
9+ | 'aof-write'
10+ | 'aof-write-active-child'
11+ | 'aof-write-alone'
12+ | 'aof-write-pending-fsync'
13+ | 'command'
14+ | 'expire-cycle'
15+ | 'eviction-cycle'
16+ | 'eviction-del'
17+ | 'fast-command'
18+ | 'fork'
19+ | 'rdb-unlink-temp-file' ;
20+
21+ export function transformArguments ( event : EventType ) : RedisCommandArguments {
22+ return [ 'LATENCY' , 'GRAPH' , event ] ;
23+ }
24+
25+ export declare function transformReply ( ) : string ;
You can’t perform that action at this time.
0 commit comments