You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Add support for T-Digest (#2214)
* wip * close #2216 - add support for TDIGEST.MERGESTORE and make compression optional on TDIGEST.CREATE * fix some tdigest commands, use bloom edge docker * fix index.ts * 2.4-RC2 (v2.4.1) * fix some commands and tests * clean code
This commit is contained in:
25
packages/bloom/lib/commands/t-digest/INFO.spec.ts
Normal file
25
packages/bloom/lib/commands/t-digest/INFO.spec.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { strict as assert } from 'assert';
|
||||
import testUtils, { GLOBAL } from '../../test-utils';
|
||||
import { transformArguments } from './INFO';
|
||||
|
||||
describe('TDIGEST.INFO', () => {
|
||||
it('transformArguments', () => {
|
||||
assert.deepEqual(
|
||||
transformArguments('key'),
|
||||
['TDIGEST.INFO', 'key']
|
||||
);
|
||||
});
|
||||
|
||||
testUtils.testWithClient('client.tDigest.info', async client => {
|
||||
await client.tDigest.create('key');
|
||||
|
||||
const info = await client.tDigest.info('key');
|
||||
assert(typeof info.capacity, 'number');
|
||||
assert(typeof info.mergedNodes, 'number');
|
||||
assert(typeof info.unmergedNodes, 'number');
|
||||
assert(typeof info.mergedWeight, 'number');
|
||||
assert(typeof info.unmergedWeight, 'number');
|
||||
assert(typeof info.totalCompression, 'number');
|
||||
assert(typeof info.totalCompression, 'number');
|
||||
}, GLOBAL.SERVERS.OPEN);
|
||||
});
|
Reference in New Issue
Block a user