TimSpeelman / in4392-lab

0 stars 1 forks source link

Add performance monitoring and scheduling #23

Closed TimSpeelman closed 6 years ago

TimSpeelman commented 6 years ago

Branched off daemon.

Each component controller (for queue and lambda) implements the MakesSnapshot interface, by returning a QueueSnapshot (number of messages in queue) or a LambdaSnapshot (number of concurrent workers running).

The PerformanceMonitor gathers the snapshots from all components into a SnapshotDict (snapshots by component name)

A Policy takes a SnapshotDict and returns a Schedule (which contains the desired number of concurrent workers for each lambda type). A simple implementation is the AlwaysOnePolicy which schedules one concurrent worker for each type.

The SimpleCloudController applies such a Schedule by setting the goal (desired number of workers) on each LambdaController