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';
81
81
import * as INFO from '../commands/INFO' ;
82
82
import * as KEYS from '../commands/KEYS' ;
83
83
import * as LASTSAVE from '../commands/LASTSAVE' ;
84
+ import * as LATENCY_DOCTOR from '../commands/LATENCY_DOCTOR' ;
85
+ import * as LATENCY_GRAPH from '../commands/LATENCY_GRAPH' ;
84
86
import * as LOLWUT from '../commands/LOLWUT' ;
85
87
import * as MEMORY_DOCTOR from '../commands/MEMORY_DOCTOR' ;
86
88
import * as MEMORY_MALLOC_STATS from '../commands/MEMORY_MALLOC-STATS' ;
@@ -113,7 +115,6 @@ import * as SWAPDB from '../commands/SWAPDB';
113
115
import * as TIME from '../commands/TIME' ;
114
116
import * as UNWATCH from '../commands/UNWATCH' ;
115
117
import * as WAIT from '../commands/WAIT' ;
116
- import * as LATENCY_DOCTOR from '../commands/LATENCY_DOCTOR' ;
117
118
118
119
export default {
119
120
...CLUSTER_COMMANDS ,
@@ -283,6 +284,8 @@ export default {
283
284
lastSave : LASTSAVE ,
284
285
LATENCY_DOCTOR ,
285
286
latencyDoctor : LATENCY_DOCTOR ,
287
+ LATENCY_GRAPH ,
288
+ latencyGraph : LATENCY_GRAPH ,
286
289
LOLWUT ,
287
290
lolwut : LOLWUT ,
288
291
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