worklist/hifi — pull request #1236 by ZappoMan (2013-11-10 21:50:54+00:00)
Title: improvements to PPS behavior of PacketSender

Fixes the VoxelEditPacketSender and PacketSender classes to reliably send at the requested packets per second no matter how low you ask the packets to send. It works properly in non-threaded and threaded modes.

Changes include:
- rewrite of PacketSender::process() to work correctly
- split out non-threaded version of PackerSender::process() into PacketSender::nonThreadedProcess() which properly handles calculation of partial packets per call to process.
- chance PacketSender::threadedProcess() to call PacketSender::nonThreadedProcess() for main work function so logic is the same
- added support to VoxelEditPacketSender for setting the packet size of the voxel edit packets
- added JS apis for setting/getting PPS and MaxPacket Size as well as sending stats
- changed animation-server to support various command line options to test all the use cases of VoxelEditPacketSender and PacketSender, including, very slow calls to process, overloading the packet queue, underloading the packet queue, etc

The old code (what you're running now), has the following problems:
- Will not send packets at less than 60pps
- Will not send packets at PPS that are not divisible evenly by 60. (For example, tt sends anything between 180-240pps at 180pps.)
- Will sometimes burst packets much higher than the requested PPS.
- Will sometimes hold onto packets and never catch up to an empty queue. even if the caller throttles their packet queuing.

The new code fixes these problems and now can reliably send packets at any pps over 1 pps. even if that pps is not evenly divisible by the "process()" call rate. So for example: if the PPS is 35 and the AC calls process() at 13 times second -- it works. Or PPS=200 and call rate=60... it works.