Lumiera  0.pre.03
»edit your freedom«
BlockFlow_test Class Reference

Description

Test:
document the memory management scheme used by the Scheduler.
See also
SchedulerActivity_test
SchedulerUsage_test

Definition at line 72 of file block-flow-test.cpp.

Private Member Functions

void adjustEpochs ()
 
void announceLoad ()
 
void handleEpoch ()
 
void placeActivity ()
 
virtual void run (Arg)
 
void simpleUsage ()
 
void storageFlow ()
 

Additional Inherited Members

- Public Member Functions inherited from Test
virtual ~Test ()=default
 this is an interface
 
lib::Random makeRandGen ()
 build a dedicated new RandomGen, seeded from the default-Gen
 
virtual void run (Arg arg)=0
 
void seedRand ()
 draw a new random seed from a common nucleus, and re-seed the default-Gen.
 
- Static Public Member Functions inherited from Test
static string firstTok (Arg)
 conveniently pick the first token from the argument line
 
static uint firstVal (Arg, uint=1)
 conveniently use some number given as argument, with optional default
 

Member Function Documentation

◆ simpleUsage()

void simpleUsage ( )
inlineprivate
Test:
demonstrate a simple usage scenario
  • open new Epoch to allocate an Activity
  • clean-up at a future time point

Definition at line 93 of file block-flow-test.cpp.

References BlockFlow< CONF >::AllocatorHandle::create(), BlockFlow< CONF >::discardBefore(), Activity::TICK, and BlockFlow< CONF >::until().

+ Here is the call graph for this function:

◆ handleEpoch()

void handleEpoch ( )
inlineprivate
Test:
cover properties and handling of Epochs (low-level)
  • demonstrate that each Epoch is placed into an Extent
  • verify that both Extent and Epoch access the same memory block
  • demonstrate the standard setup and initialisation of an Epoch
  • allocate some Activities into the storage and observe free-managment
  • detect when the Epoch is filled up
  • verify alive / dead decision relative to given deadline
Note
this test covers helpers and implementation structures of BlockFlow, without actually using a BlockFlow instance; rather, the typical handling and low-level bookkeeping aspects are emulated and observed

Definition at line 124 of file block-flow-test.cpp.

◆ placeActivity()

void placeActivity ( )
inlineprivate
Test:
place Activity record into storage
  • new Activity without any previously established Epoch
  • place Activity into future, expanding the Epoch grid
  • locate Activity relative to established Epoch grid
  • fill up existing Epoch, causing overflow to next one
  • exhaust multiple adjacent Epochs, overflowing to first free one
  • exhaust last Epoch, causing setup of new Epoch, with reduced spacing
  • use this reduced spacing also for subsequently created Epochs
  • clean up obsoleted Epochs, based on given deadline

Definition at line 221 of file block-flow-test.cpp.

References BlockFlow< CONF >::AllocatorHandle::create(), and BlockFlow< CONF >::until().

+ Here is the call graph for this function:

◆ adjustEpochs()

void adjustEpochs ( )
inlineprivate
Test:
load based regulation of Epoch spacing
  • on overflow, capacity is boosted by a fixed factor
  • on clean-up, a moving average of (in hindsight) optimal length is computed and used as the new Epoch spacing

Definition at line 315 of file block-flow-test.cpp.

◆ announceLoad()

void announceLoad ( )
inlineprivate
Test:
announce additional load to reserve additional capacity up-front.

Definition at line 358 of file block-flow-test.cpp.

◆ storageFlow()

void storageFlow ( )
inlineprivate
Test:
investigate progression of epochs under realistic load
  • expose the allocator to a load of 200fps for simulated 3 Minutes
  • assuming 10 Activities per frame, this means a throughput of 360000 Activities
  • run this load exposure under saturation for performance measurement
  • use a planning to deadline delay of 500ms, but with ±200ms random spread
  • after 250ms (500 steps), »invoke« by accessing and adding the random checksum
  • run a comparison of all-pre-allocated ⟷ heap allocated ⟷ Refcount ⟷ BlockFlow
Remarks
This test setup can be used to investigate different load scenarios. In the standard as defined, the BlockFlow allocator is overloaded initially; within 5 seconds, the algorithm should have regulated the Epoch stepping down to accommodate the load peak. As immediate response, excess allocation requests are shifted into later Epochs. To cope with a persisting higher load, the spacing is reduced swiftly, by growing the internal pool with additional heap allocated Extents. In the following balancing phase, the mechanism aims at bringing back the Epoch duration into a narrow corridor, to keep the usage quotient as close as possible to 90%

Definition at line 395 of file block-flow-test.cpp.

+ Inheritance diagram for BlockFlow_test:
+ Collaboration diagram for BlockFlow_test:

The documentation for this class was generated from the following file: