The deque defaults to a max_size of 100. When you pass in a custom size to the _StatRecorder constructor, it changes the default_factory of the parent defaultdict to produce deques of the requested size. However, any deques that were already written to will have the original size of 100.
This should be cleaned up to make it more predictable/consistent.