Table of Contents

Class DefaultBatchSizeStrategy

Namespace
CounterpointCollective.Dataflow
Assembly
Dataflow.Composable.dll

Default implementation that monitors throughput and adjusts batch size accordingly.

public class DefaultBatchSizeStrategy : IBatchSizeStrategy
Inheritance
DefaultBatchSizeStrategy
Implements
Inherited Members

Constructors

DefaultBatchSizeStrategy(int, int, int, double, double, int, int)

Default implementation that monitors throughput and adjusts batch size accordingly.

public DefaultBatchSizeStrategy(int minBatchSize = 1, int maxBatchSize = 50, int initialBatchSize = 50, double adjustmentSensitivity = 0.1, double maxAdjustmentFraction = 0.1, int dampeningWindowSize = 5, int maxQueryTimeSeconds = 60)

Parameters

minBatchSize int
maxBatchSize int
initialBatchSize int
adjustmentSensitivity double

Controls how aggressively the strategy reacts to throughput changes. Higher values cause larger adjustments; lower values make the strategy steadier.

maxAdjustmentFraction double

Limits how far the batch size may move in a single adjustment, expressed as a fraction of the allowed batch size range. Prevents sudden large jumps.

dampeningWindowSize int

Number of recent calculated setpoints to average together to smooth fluctuations. Larger values produce a more stable, slower-responding batch size.

maxQueryTimeSeconds int

Maximum expected duration of a single batch run, used for safety/timeout logic.

Properties

BatchSize

public int BatchSize { get; }

Property Value

int

DebugView

public BatchSizeCalculation DebugView { get; }

Property Value

BatchSizeCalculation

Methods

UpdateBatchSize(int, double)

public int UpdateBatchSize(int batchSize, double totalRunMillis)

Parameters

batchSize int
totalRunMillis double

Returns

int