1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
This commit is contained in:
Leibale
2023-07-18 16:32:45 -04:00
parent 8501db0243
commit fdd1978d92
43 changed files with 377 additions and 506 deletions

View 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();
}
};
};

View 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();
}
};
};

View File

@@ -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);