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.
This solves two problems:
1. redundant trackers making redundant requests
2. trackers being obliterated as soon as the primary metric component
is destroyed
It introduces a new problem where visiting more and more node and
allocation pages adds to an ever-growing list of trackers that can
assume lots of memory, but it solves the problem by using a
least-recently-used cache to limit the number of trackers tracked.
When data is coming in live, the tooltip can get bogged down by updates
causing the tooltip to never make it under the mouse, which looks like
either lag or a bug.
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.
* 'master' of https://github.com/hashicorp/nomad: (59 commits)
Test coverage for the promote canary feature
Update README.md
launcher readme
Add stats to launcher
Add stats to example plugin
Example device plugin and helpers
Fix the flickering issue with start/stop job
Add a confirmation loading state to the two-step-button component
Switch stop/run job actions to EC tasks
Test coverage for the Start Job behavior
Add Start Job action on the job overview page for when a job is dead
gofmt -s
Update the info message about token storage
Switch token storage to localStorage from sessionStorage
add stats to device interface
Change the latest deployment component to include a Promote Canary button
Support the promote deployment api action
Simplify the data control flow around job.plan()
statistics protos
Acceptance tests for the edit behaviors on the job definition page
...