TerminusDB.Benchmark (terminusdb_ex v0.3.3)

Copy Markdown View Source

Benchmarking helpers for terminusdb_ex.

Provides utilities for generating test data, seeding databases, and creating representative WOQL queries for benchmarking.

Quick start

# Generate test data
people = TerminusDB.Benchmark.generate_data(1000)

# Seed a database
config = TerminusDB.Benchmark.seed_database(config, 500)

# Get representative queries
queries = TerminusDB.Benchmark.generate_queries(100)

Summary

Functions

Generates count Person documents with random names and ages.

Returns path patterns of varying complexity for benchmarking.

Returns a list of representative WOQL queries for benchmarking.

Creates a database with a Person schema and inserts count documents.

Functions

generate_data(count)

@spec generate_data(pos_integer()) :: [map()]

Generates count Person documents with random names and ages.

generate_path_patterns()

@spec generate_path_patterns() :: [String.t()]

Returns path patterns of varying complexity for benchmarking.

generate_queries(count)

@spec generate_queries(pos_integer()) :: [TerminusDB.WOQL.t()]

Returns a list of representative WOQL queries for benchmarking.

seed_database(config, count)

@spec seed_database(TerminusDB.Config.t(), pos_integer()) ::
  {TerminusDB.Config.t(), String.t()}

Creates a database with a Person schema and inserts count documents.

Returns {config, db_name} so callers can clean up the database after benchmarking.