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
minBatchSizeintmaxBatchSizeintinitialBatchSizeintadjustmentSensitivitydoubleControls how aggressively the strategy reacts to throughput changes. Higher values cause larger adjustments; lower values make the strategy steadier.
maxAdjustmentFractiondoubleLimits 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.
dampeningWindowSizeintNumber of recent calculated setpoints to average together to smooth fluctuations. Larger values produce a more stable, slower-responding batch size.
maxQueryTimeSecondsintMaximum expected duration of a single batch run, used for safety/timeout logic.
Properties
BatchSize
public int BatchSize { get; }
Property Value
DebugView
public BatchSizeCalculation DebugView { get; }
Property Value
Methods
UpdateBatchSize(int, double)
public int UpdateBatchSize(int batchSize, double totalRunMillis)