You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
WIP
This commit is contained in:
23
benchmark/lib/ping/local-resp3-buffer-proxy.js
Normal file
23
benchmark/lib/ping/local-resp3-buffer-proxy.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import { createClient, RESP_TYPES } from 'redis-local';
|
||||
|
||||
export default async (host) => {
|
||||
const client = createClient({
|
||||
socket: {
|
||||
host
|
||||
},
|
||||
RESP: 3
|
||||
}).withTypeMapping({
|
||||
[RESP_TYPES.SIMPLE_STRING]: Buffer
|
||||
});
|
||||
|
||||
await client.connect();
|
||||
|
||||
return {
|
||||
benchmark() {
|
||||
return client.ping();
|
||||
},
|
||||
teardown() {
|
||||
return client.disconnect();
|
||||
}
|
||||
};
|
||||
};
|
24
benchmark/lib/ping/local-resp3-buffer.js
Normal file
24
benchmark/lib/ping/local-resp3-buffer.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { createClient, RESP_TYPES } from 'redis-local';
|
||||
|
||||
export default async (host) => {
|
||||
const client = createClient({
|
||||
socket: {
|
||||
host
|
||||
},
|
||||
commandOptions: {
|
||||
[RESP_TYPES.SIMPLE_STRING]: Buffer
|
||||
},
|
||||
RESP: 3
|
||||
});
|
||||
|
||||
await client.connect();
|
||||
|
||||
return {
|
||||
benchmark() {
|
||||
return client.ping();
|
||||
},
|
||||
teardown() {
|
||||
return client.disconnect();
|
||||
}
|
||||
};
|
||||
};
|
@@ -73,11 +73,11 @@ const benchmarkStart = process.hrtime.bigint(),
|
||||
json = {
|
||||
// timestamp,
|
||||
operationsPerSecond: times / Number(benchmarkNanoseconds) * 1_000_000_000,
|
||||
// p0: histogram.getValueAtPercentile(0),
|
||||
// p50: histogram.getValueAtPercentile(50),
|
||||
// p95: histogram.getValueAtPercentile(95),
|
||||
// p99: histogram.getValueAtPercentile(99),
|
||||
// p100: histogram.getValueAtPercentile(100)
|
||||
p0: histogram.getValueAtPercentile(0),
|
||||
p50: histogram.getValueAtPercentile(50),
|
||||
p95: histogram.getValueAtPercentile(95),
|
||||
p99: histogram.getValueAtPercentile(99),
|
||||
p100: histogram.getValueAtPercentile(100)
|
||||
};
|
||||
console.log(`[${basename(path)}]:`);
|
||||
console.table(json);
|
||||
|
Reference in New Issue
Block a user