databases
Database clients
p50: 5ms · p99: 200ms
PostgreSQL
Wrap pg Pool queries with the postgres preset. Includes Jest examples for timeout and connection pool testing.
p50: 1ms · p99: 20ms
Redis
Wrap ioredis with withLatencyAll. Test cache-miss latency and slow-cache timeout behaviour.
p50: 8ms · p99: 250ms
MongoDB
Wrap native MongoDB driver collections. Covers findOne, insertOne, and Mongoose patterns.
p50: 5ms · p99: 200ms
Prisma
Wrap individual Prisma operations and helper patterns. Explains why withLatencyAll needs special handling with Prisma.
ai apis
AI model APIs
external apis
External services
p50: 200ms · p99: 2s
Stripe
Wrap stripe.paymentIntents and other resource methods. Test checkout UX and payment timeout handling.
p50: 30ms · p99: 500ms
AWS S3
Wrap @aws-sdk/client-s3 send commands. Test upload timeout and multipart retry behaviour.
p50: 80ms · p99: 1s
fetch / axios
Wrap native fetch, axios, or any HTTP client. Generic integration for any REST API.
frameworks
Frameworks
don't see your stack?
Any async function works
slowdep wraps any function that returns a Promise. If your library or client isn't listed, wrap its methods directly:
import { withLatency, withLatencyAll } from 'slowdep'; // Wrap a single method const slowSend = withLatency(client.send.bind(client), { p50: 50, p99: 400, errorRate: 0.005, }); // Wrap all async methods on a client object const slowClient = withLatencyAll(client, { p50: 50, p99: 400 });