Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Latest commit

 

History

History
1209 lines (602 loc) · 35.2 KB

File metadata and controls

1209 lines (602 loc) · 35.2 KB

Protocol Documentation

Table of Contents

Top

run.proto

DriverConfig

DriverConfig contains configuration for connecting to a database driver. It includes the driver plugin path, connection URL, and database-specific settings.

Field Type Label Description
driver_plugin_path string Path to the driver plugin binary
driver_plugin_args string repeated Additional arguments for the driver plugin
url string Database connection URL
db_specific Value.Struct optional Database-specific configuration options

GoExecutor

GoExecutor contains configuration specific to Go-based test execution. It controls Go runtime parameters and error handling behavior.

Field Type Label Description
go_max_proc uint64 optional Maximum number of OS threads that the Go runtime can use (0 = use default)
cancel_on_error bool optional Whether to cancel execution on first error

K6Executor

K6Executor contains configuration for k6 load testing tool integration. It contains paths to the k6 binary and the k6 test script, as well as additional arguments to pass to the k6 binary.

Field Type Label Description
k6_binary_path string Path to the k6 binary
k6_binary_args string repeated Additional arguments to pass to the k6 binary
k6_script_path string Path to the k6 test script
k6_setup_timeout google.protobuf.Duration optional Timeout for k6 setup phase
k6_vus uint64 optional Number of virtual users
k6_max_vus uint64 optional Maximum number of virtual users
k6_rate uint64 optional Number of requests per second
k6_duration google.protobuf.Duration optional Duration of the test
otlp_export OtlpExport optional OpenTelemetry export configuration

LoggerConfig

LoggerConfig contains configuration for the logging system. It controls log levels and output formatting.

Field Type Label Description
log_level LoggerConfig.LogLevel Minimum log level to output
log_mode LoggerConfig.LogMode Logging mode (development or production)

OtlpExport

OtlpExport contains configuration for exporting metrics via OpenTelemetry Protocol (OTLP). It specifies the endpoint and metrics prefix for telemetry data export.

Field Type Label Description
otlp_grpc_endpoint string optional gRPC endpoint for OpenTelemetry collector
otlp_metrics_prefix string optional Prefix to be added to all exported metrics

RequestedStep

RequestedStep defines a step that should be executed during the benchmark. It specifies the step name and the type of executor to use.

Field Type Label Description
name string Unique name of the step
executor RequestedStep.ExecutorType optional Type of executor to use for this step

RunConfig

RunConfig contains the complete configuration for a benchmark run.

Field Type Label Description
seed uint64 Random seed for reproducible test runs
descriptor_path string Path to the benchmark descriptor file
driver DriverConfig Database driver configuration
go_executor GoExecutor Go executor configuration
k6_executor K6Executor k6 executor configuration
steps RequestedStep repeated List of steps to execute in order
logger LoggerConfig Logging configuration

StepContext

StepContext provides contextual information to a benchmark step during execution. It contains the current configuration and descriptors relevant to the step.

Field Type Label Description
config RunConfig Current run configuration
benchmark BenchmarkDescriptor Benchmark descriptor
step StepDescriptor Current step descriptor

LoggerConfig.LogLevel

Name Number Description
LOG_LEVEL_DEBUG 0
LOG_LEVEL_INFO 1
LOG_LEVEL_WARN 2
LOG_LEVEL_ERROR 3
LOG_LEVEL_FATAL 4

LoggerConfig.LogMode

Name Number Description
LOG_MODE_DEVELOPMENT 0
LOG_MODE_PRODUCTION 1

RequestedStep.ExecutorType

Name Number Description
EXECUTOR_TYPE_GO 0
EXECUTOR_TYPE_K6 1

Top

descriptor.proto

BenchmarkDescriptor

BenchmarkDescriptor defines a complete benchmark consisting of multiple steps.

Field Type Label Description
name string Name of the benchmark
steps StepDescriptor repeated List of steps to execute in the benchmark

ColumnDescriptor

ColumnDescriptor defines the structure of a database column.

Field Type Label Description
name string Name of the column
sql_type string SQL data type of the column
nullable bool Whether the column can be NULL
primary_key bool Whether the column is part of the primary key
unique bool Whether the column has a UNIQUE constraint
constraint string SQL constraint definition for the column

IndexDescriptor

IndexDescriptor defines the structure of a database index.

Field Type Label Description
name string Name of the index
columns string repeated List of column names that are part of this index
type string Type of index (e.g., BTREE, HASH, etc.)
unique bool Whether this is a unique index
db_specific Value.Struct optional Database-specific index properties

QueryDescriptor

QueryDescriptor defines a database query with its parameters and execution count.

Field Type Label Description
name string Name of the query
sql string SQL query text
params QueryParamDescriptor repeated Parameters used in the query
count uint64 Number of times to execute this query
db_specific Value.Struct Database-specific query properties

QueryParamDescriptor

QueryParamDescriptor defines a parameter that can be used in a query.

Field Type Label Description
name string Name of the parameter
replace_regex string Regular expression pattern to replace with the parameter value default is "${<param_name>}"
generation_rule Generation.Rule Rule for generating parameter values
db_specific Value.Struct Database-specific parameter properties

StepDescriptor

StepDescriptor represents a logical step in a benchmark.

Field Type Label Description
name string Name of the step
queries StepQueryDescriptor repeated List of operations to perform in this step
async bool Whether to execute all operations in this step asynchronously

StepQueryDescriptor

StepQueryDescriptor represents a single query or table creation operation that can be part of a benchmark step.

Field Type Label Description
create_table TableDescriptor Table creation operation
query QueryDescriptor Query execution operation
transaction TransactionDescriptor Transaction execution operation
async bool Whether to execute this operation asynchronously

TableDescriptor

TableDescriptor defines the structure of a database table.

Field Type Label Description
name string Name of the table
table_indexes IndexDescriptor repeated List of indexes defined on this table
constraint string Table-level constraints
db_specific Value.Struct Database-specific table properties
columns ColumnDescriptor repeated Columns defined in this table

TransactionDescriptor

TransactionDescriptor defines a database transaction with its queries and execution count.

Field Type Label Description
name string Name of the transaction
isolation_level TxIsolationLevel Transaction isolation level
queries QueryDescriptor repeated List of queries to execute in this transaction
count uint64 Number of times to execute this transaction
db_specific Value.Struct Database-specific transaction properties

TxIsolationLevel

TransactionIsolationLevel defines the isolation level for a database transaction.

Name Number Description
TX_ISOLATION_LEVEL_UNSPECIFIED 0
TX_ISOLATION_LEVEL_READ_UNCOMMITTED 1
TX_ISOLATION_LEVEL_READ_COMMITTED 2
TX_ISOLATION_LEVEL_REPEATABLE_READ 3
TX_ISOLATION_LEVEL_SERIALIZABLE 4

Top

plugins.proto

BuildQueriesContext

BuildQueriesContext provides the context needed to build database queries.

Field Type Label Description
context StepContext
query StepQueryDescriptor

DriverQueriesList

DriverQueriesList is a collection of DriverQuery messages.

Field Type Label Description
queries DriverQuery repeated

DriverQuery

DriverQuery represents a query that can be executed by a database driver.

Field Type Label Description
name string
request string
params Value repeated

DriverPlugin

DriverPlugin defines the gRPC service that database driver plugins must implement.

Method Name Request Type Response Type Description
Initialize StepContext .google.protobuf.Empty
BuildQueries BuildQueriesContext DriverQueriesList
RunQuery DriverQuery .google.protobuf.Empty
Teardown .google.protobuf.Empty .google.protobuf.Empty

Top

common.proto

DateTime

DateTime represents a point in time, independent of any time zone or calendar.

Field Type Label Description
value google.protobuf.Timestamp Timestamp in UTC

Decimal

Decimal represents an arbitrary-precision decimal number.

Field Type Label Description
value string String representation of the decimal number

Generation

Generation contains configuration for generating test data. It provides rules and constraints for generating various types of data.

UTF-8 character ranges for different languages Example: {"en": {{65, 90}, {97, 122}}}

Generation.Alphabet

Alphabet defines character ranges for string generation.

Field Type Label Description
ranges Generation.Range.UInt32Range repeated List of character ranges for this alphabet

Generation.Distribution

Distribution defines the statistical distribution for value generation.

Field Type Label Description
type Generation.Distribution.DistributionType Type of distribution to use
screw double Distribution parameter (e.g., standard deviation for normal distribution)

Generation.Range

Range defines value constraints for generation.

Generation.Range.AnyStringRange

Range for string values that can be parsed into other types

Field Type Label Description
min string Minimum value (inclusive)
max string Maximum value (inclusive)

Generation.Range.DateTimeRange

Range for date/time values

Field Type Label Description
default Generation.Range.DateTimeRange.Default Exact date/time range
string Generation.Range.AnyStringRange String-based range (ISO 8601 format)
timestamp_pb Generation.Range.DateTimeRange.TimestampPb Protocol Buffers timestamp range
timestamp Generation.Range.DateTimeRange.Timestamp Unix timestamp range

Generation.Range.DateTimeRange.Default

Default date/time range

Field Type Label Description
min DateTime Minimum timestamp (inclusive)
max DateTime Maximum timestamp (inclusive)

Generation.Range.DateTimeRange.Timestamp

Unix timestamp range

Field Type Label Description
min uint32 Minimum Unix timestamp (inclusive)
max uint32 Maximum Unix timestamp (inclusive)

Generation.Range.DateTimeRange.TimestampPb

Protocol Buffers timestamp range

Field Type Label Description
min google.protobuf.Timestamp Minimum timestamp (inclusive)
max google.protobuf.Timestamp Maximum timestamp (inclusive)

Generation.Range.DecimalRange

Range for decimal numbers

Field Type Label Description
default Generation.Range.DecimalRange.Default Exact decimal range
float Generation.Range.FloatRange Float-based range
double Generation.Range.DoubleRange Double-based range
string Generation.Range.AnyStringRange String-based range (supports scientific notation)

Generation.Range.DecimalRange.Default

Default decimal range

Field Type Label Description
min Decimal Minimum value (inclusive)
max Decimal Maximum value (inclusive)

Generation.Range.DoubleRange

Range for 64-bit floating point numbers

Field Type Label Description
min double Minimum value (inclusive)
max double Maximum value (inclusive)

Generation.Range.FloatRange

Range for 32-bit floating point numbers

Field Type Label Description
min float Minimum value (inclusive)
max float Maximum value (inclusive)

Generation.Range.Int32Range

Range for 32-bit signed integers

Field Type Label Description
min int32 Minimum value (inclusive)
max int32 Maximum value (inclusive)

Generation.Range.Int64Range

Range for 64-bit signed integers

Field Type Label Description
min int64 Minimum value (inclusive)
max int64 Maximum value (inclusive)

Generation.Range.UInt32Range

Range for 32-bit unsigned integers

Field Type Label Description
min uint32 Minimum value (inclusive)
max uint32 Maximum value (inclusive)

Generation.Range.UInt64Range

Range for 64-bit unsigned integers

Field Type Label Description
min uint64 Minimum value (inclusive)
max uint64 Maximum value (inclusive)

Generation.Rule

Rule defines generation rules for a specific data type.

Field Type Label Description
float_rules Generation.Rules.FloatRule Rules for 32-bit floating point numbers
double_rules Generation.Rules.DoubleRule Rules for 64-bit floating point numbers
int32_rules Generation.Rules.Int32Rule Rules for 32-bit signed integers
int64_rules Generation.Rules.Int64Rule Rules for 64-bit signed integers
uint32_rules Generation.Rules.UInt32Rule Rules for 32-bit unsigned integers
uint64_rules Generation.Rules.UInt64Rule Rules for 64-bit unsigned integers
bool_rules Generation.Rules.BoolRule Rules for boolean values
string_rules Generation.Rules.StringRule Rules for string values
datetime_rules Generation.Rules.DateTimeRule Rules for date/time values
uuid_rules Generation.Rules.UuidRule Rules for UUIDs
decimal_rules Generation.Rules.DecimalRule Rules for decimal numbers
distribution Generation.Distribution optional
null_percentage uint32 optional
unique bool optional

Generation.Rules

Rules contains type-specific generation configurations.

Generation.Rules.BoolRule

Rules for generating boolean values

Field Type Label Description
constant bool optional Fixed value (if not specified, generates random booleans)

Generation.Rules.DateTimeRule

Rules for generating date/time values

Field Type Label Description
range Generation.Range.DateTimeRange Valid time range
constant DateTime optional Fixed value (if specified, overrides range)

Generation.Rules.DecimalRule

Rules for generating decimal numbers

Field Type Label Description
range Generation.Range.DecimalRange Valid value range
constant Decimal optional Fixed value (if specified, overrides range)

Generation.Rules.DoubleRule

Rules for generating 64-bit floating point numbers

Field Type Label Description
range Generation.Range.DoubleRange Valid value range
constant double optional Fixed value (if specified, overrides range)

Generation.Rules.FloatRule

Rules for generating 32-bit floating point numbers

Field Type Label Description
range Generation.Range.FloatRange Valid value range
constant float optional Fixed value (if specified, overrides range)

Generation.Rules.Int32Rule

Rules for generating 32-bit signed integers

Field Type Label Description
range Generation.Range.Int32Range Valid value range
constant int32 optional Fixed value (if specified, overrides range)

Generation.Rules.Int64Rule

Rules for generating 64-bit signed integers

Field Type Label Description
range Generation.Range.Int64Range Valid value range
constant int64 optional Fixed value (if specified, overrides range)

Generation.Rules.StringRule

Rules for generating string values

Field Type Label Description
alphabet Generation.Alphabet optional Character set to use for generation
len_range Generation.Range.UInt64Range Valid length range for the string
constant string optional Fixed value (if specified, overrides generation)

Generation.Rules.UInt32Rule

Rules for generating 32-bit unsigned integers

Field Type Label Description
range Generation.Range.UInt32Range Valid value range
constant uint32 optional Fixed value (if specified, overrides range)

Generation.Rules.UInt64Rule

Rules for generating 64-bit unsigned integers

Field Type Label Description
range Generation.Range.UInt64Range Valid value range
constant uint64 optional Fixed value (if specified, overrides range)

Generation.Rules.UuidRule

Rules for generating UUIDs

Field Type Label Description
constant Uuid optional Fixed UUID (if not specified, generates random UUIDs)

Uuid

Uuid represents a universally unique identifier (UUID).

Field Type Label Description
value string String representation of UUID (e.g., "123e4567-e89b-12d3-a456-426614174000")

Value

Value is a variant type that can represent different types of values. It's used to represent values that can be of multiple types in a type-safe way.

Field Type Label Description
null Value.NullValue Null value
int32 int32 32-bit signed integer
uint32 uint32 32-bit unsigned integer
int64 int64 64-bit signed integer
uint64 uint64 64-bit unsigned integer
float float 32-bit floating point number
double double 64-bit floating point number
string string UTF-8 encoded string
bool bool Boolean value
decimal Decimal Arbitrary-precision decimal
uuid Uuid Universally unique identifier
datetime DateTime Date and time
struct Value.Struct Nested structure
list Value.List List of values
key string Field name (used in structs)

Value.List

Field Type Label Description
values Value repeated List of values

Value.Struct

Field Type Label Description
fields Value repeated Map of field names to values

Generation.Distribution.DistributionType

Name Number Description
NORMAL 0 Normal (Gaussian) distribution
UNIFORM 1 Uniform distribution
ZIPF 2 Zipfian distribution

Value.NullValue

Name Number Description
NULL_VALUE 0 Null value

Scalar Value Types

.proto Type Notes C++ Java Python Go C# PHP Ruby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)