FerryTempo / FTServer

A NodeJS implementation of the FerryTempo service.
https://www.ferrytempo.com/
1 stars 0 forks source link

14 compute departure delay average #68

Closed ckulfan closed 4 months ago

ckulfan commented 4 months ago

This is a bit of an involved commit. In order to compute averages, we need to have stateful storage of the prior departure times. In order to keep storage down, I am just storing a running average and a count on a per boat and/or port basis. In this implementation the storage does not persist across restarts. In order to facilitate this in the future, I created a StorageManager class to allow us to modify the storage in the future.

Also added unit tests for the StorageManager and for the new average functions inside Utils.