Skip to content

PgBencher

Namespace: Ankus

Assembly: Ankus.Runtime.dll

Registers exactly one timing loop for a PostgreSQL benchmark.

public sealed class PgBencher

Inheritance: object

public PgBencher()

Registers a timing loop that reuses its captured inputs.

public void Iterate(Action routine)

Parameters:

routine — Action

The synchronous work to measure.

IterateBatched<TInput>(Func<TInput>, Action<TInput>, PgBenchmarkBatchSize)

Section titled “IterateBatched<TInput>(Func<TInput>, Action<TInput>, PgBenchmarkBatchSize)”

Registers a loop that prepares one input immediately before each invocation. Input preparation is included in the elapsed sample.

public void IterateBatched<TInput>(Func<TInput> setup, Action<TInput> routine, PgBenchmarkBatchSize batchSize)

Type parameters:

TInput

The prepared input type.

Parameters:

setup — Func<TInput>

The input factory.

routine — Action<TInput>

The synchronous work to measure.

batchSize — PgBenchmarkBatchSize

The input batching strategy.

IterateBatched<TInput, TResult>(Func<TInput>, Func<TInput, TResult>, PgBenchmarkBatchSize)

Section titled “IterateBatched<TInput, TResult>(Func<TInput>, Func<TInput, TResult>, PgBenchmarkBatchSize)”

Registers a result-producing loop that prepares one input immediately before each invocation. Input preparation is included in the elapsed sample.

public void IterateBatched<TInput, TResult>(Func<TInput> setup, Func<TInput, TResult> routine, PgBenchmarkBatchSize batchSize)

Type parameters:

TInput

The prepared input type.

TResult

The measured result type.

Parameters:

setup — Func<TInput>

The input factory.

routine — Func<TInput, TResult>

The synchronous work to measure.

batchSize — PgBenchmarkBatchSize

The input batching strategy.

Registers a timing loop that reuses its captured inputs and consumes its result.

public void Iterate<TResult>(Func<TResult> routine)

Type parameters:

TResult

The result type.

Parameters:

routine — Func<TResult>

The synchronous work to measure.