Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 68 additions & 13 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
],
"scripts": {
"benchmark:request-local": "pnpm build && node scripts/benchmark-request-local.mjs",
"benchmark:stale-on-error": "pnpm build && node scripts/benchmark-stale-on-error.mjs",
"build": "tsup src/index.ts src/datadog.ts src/node-redis.ts src/prometheus.ts src/redis-protocol.ts src/valkey-glide.ts --format esm,cjs --dts --clean",
"check": "pnpm typecheck && pnpm test && pnpm build && pnpm test:package",
"typecheck": "tsc --noEmit",
Expand Down
4 changes: 4 additions & 0 deletions scripts/benchmark-request-local.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ async function benchmarkRedisReadDeadlineCoalescing(fanout) {
const originalSetTimeout = globalThis.setTimeout;
const originalClearTimeout = globalThis.clearTimeout;
const redisClient = {
enforcesMaxAge: true,
async read() {
redisReadCalls += 1;
started.resolve();
Expand Down Expand Up @@ -319,6 +320,7 @@ async function benchmarkSequentialTrackedRedisHits(iterations, { scenario, useCa
let redisWriteCalls = 0;
let redisInvalidationCalls = 0;
const redisClient = {
enforcesMaxAge: true,
async read({ watermarkKey }) {
assert.equal(typeof watermarkKey, "string", "the benchmark must exercise tracked Redis reads");
redisReadCalls += 1;
Expand Down Expand Up @@ -392,6 +394,7 @@ async function benchmarkDarkShadowDetachment() {
const cachedValue = { source: "redis" };
const sourceValue = { source: "truth" };
const redisClient = {
enforcesMaxAge: true,
async read({ watermarkKey }) {
assert.equal(typeof watermarkKey, "string", "dark shadow reads must remain tracked");
redisReadCalls += 1;
Expand Down Expand Up @@ -476,6 +479,7 @@ async function benchmarkDarkShadowFillDetachment() {
let redisWriteCalls = 0;
const sourceValue = { source: "truth" };
const redisClient = {
enforcesMaxAge: true,
async read({ watermarkKey }) {
assert.equal(typeof watermarkKey, "string", "dark shadow reads must remain tracked");
redisReadCalls += 1;
Expand Down
Loading
Loading