This is extracted from #8094, where I have run into some snags. Since
these ESLint fixes aren’t actually connected to the Ember 3.16 update
but involve changes to many files, we might as well address them
separately. Where possible I fixed the problems but in cases where
a fix seemed too involved, I added per-line or -file exceptions.
1. Check if the response is a 4xx/5xx
2. If it is, skip the append step and track a frame miss
3. If enough frame misses occur in a row, treat it as a pause
A "pause" is when a null data frame is added, which shows up as a
gap in line charts.
This is the best of three options
1. Users of stats trackers control polling (old method)
2. Stat tracker is stateful and has start/stop methods (like logging)
3. Stat trackers blindly throttle requests
This is the best option because it means N number of concurrent users of
a stats tracker can request polling without inundating the tracker with
redundant frames (or the network with redundant requests), but they also
don't have to coordinate amongst themselves to determine what state a
tracker should be in.
It follows the form of poll -> json parse -> append,
Where append is defined in subclasses to add data from the new frame
to long-lived rolling arrays of data.