benchmark/README.md
A command-line tool for benchmarking, testing, and managing Typesense server installations. This tool provides utilities for installing specific versions of Typesense, running integration tests, and performing various benchmark operations.
git clone [repository-url]
cd benchmark
pnpm install
pnpm build
The tool provides three main commands: install, test, and benchmark.
typesense-benchmark install [options]
Options:
-n, --container-name <name> Name for the Docker container (default: "bazel-build")
-i, --image-name <image> Name for the Docker image (default: "ubuntu-build")
-g, --typesense-git-url <url> Git URL for the Typesense repo
-d, --working-directory <dir> Working directory for installation
-c, --commitHash <hash> Specific commit to install
-y, --yes Answer yes to all prompts
-v, --verbose Enable verbose output
typesense-benchmark test [options]
Options:
-n, --container-name <name> Name for the Docker container
-i, --image-name <image> Name for the Docker image
-g, --typesense-git-url <url> Git URL for the Typesense repo
-d, --working-directory <dir> Working directory for tests
-c, --commitHash <hash> Specific commit to test
-b, --binary <path> Path to pre-built binary
--api-key <key> API key for Typesense (default: "xyz")
--openAI-key <key> OpenAI API key
--ip <ip> IP address for Typesense
-s, --snapshot-path <path> Path for snapshot files
-v, --verbose Enable verbose output
-y, --yes Answer yes to all prompts
typesense-benchmark benchmark [options]
Options:
--commit-hashes <hashes...> Commits to compare
--binaries <paths...> Paths to pre-built binaries to compare
--batch-size <num> Batch size for indexing (default: 100)
--duration <time> Duration for search tests (e.g., "30s", "1m")
--fail <percentage> Regression threshold percentage (default: 50)
--api-key <key> API key for Typesense
-v, --verbose Enable verbose output
The tool can be configured through command-line options or environment variables:
OPENAI_API_KEY: Your OpenAI API key for embedding testsCore configuration files:
tsconfig.json: TypeScript configurationtsup.config.ts: Build configurationeslint.config.mjs: Linting rulesbenchmark/
├── src/
│ ├── commands/ # CLI commands
│ ├── services/ # Core services
│ │ ├── docker.ts # Docker management
│ │ ├── k6.ts # k6 load testing
│ │ └── typesense-process.ts # Process control
│ ├── benchmarks/ # Benchmark scenarios
│ └── utils/ # Utility functions
├── test/ # Test files
└── dist/ # Compiled output
# Run all tests
pnpm test
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)Please ensure that:
Created and maintained by Typesense, Inc. ([email protected])
Contributors: