-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for
LATENCY LATEST
(#2514)
* Add support for LATENCY LATEST. * Fix the review comments. * Fix the review comments. * Update LATENCY_LATEST.ts * Update dockers.ts * Update LATENCY_GRAPH.spec.ts * enable debug mode in tests --------- Co-authored-by: Leibale Eidelman <[email protected]>
- Loading branch information
Showing
5 changed files
with
57 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import {strict as assert} from 'assert'; | ||
import testUtils, {GLOBAL} from '../test-utils'; | ||
import { transformArguments } from './LATENCY_LATEST'; | ||
|
||
describe('LATENCY LATEST', () => { | ||
it('transformArguments', () => { | ||
assert.deepEqual( | ||
transformArguments(), | ||
['LATENCY', 'LATEST'] | ||
); | ||
}); | ||
|
||
testUtils.testWithClient('client.latencyLatest', async client => { | ||
await Promise.all([ | ||
client.configSet('latency-monitor-threshold', '100'), | ||
client.sendCommand(['DEBUG', 'SLEEP', '1']) | ||
]); | ||
const latency = await client.latencyLatest(); | ||
assert.ok(Array.isArray(latency)); | ||
for (const [name, timestamp, latestLatency, allTimeLatency] of latency) { | ||
assert.equal(typeof name, 'string'); | ||
assert.equal(typeof timestamp, 'number'); | ||
assert.equal(typeof latestLatency, 'number'); | ||
assert.equal(typeof allTimeLatency, 'number'); | ||
} | ||
}, GLOBAL.SERVERS.OPEN); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RedisCommandArguments } from '.'; | ||
|
||
export function transformArguments(): RedisCommandArguments { | ||
return ['LATENCY', 'LATEST']; | ||
} | ||
|
||
export declare function transformReply(): Array<[ | ||
name: string, | ||
timestamp: number, | ||
latestLatency: number, | ||
allTimeLatency: number | ||
]>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters