Still very much a work-in-progress.
* Adds configuration entries for enabling long-term stats
collection (`gather_stats`) and collation period.
* Spawns a collection thread (if `gather_stats` is enabled)
that collects total traffic and per-host traffic/RTT
(with circuit ID) on the same 1s cadence as throughput
collection.
* Spawns a collator thread that gathers all of the collection
summaries generated since the last collation (every
`collation_period_seconds` seconds). The gathered stats are
divided into min/max/mean average for each circuit.
* Collated stats are handed to a submissions system, that is
currently a bare-bones "keep last" - this will be extended!
* Add a `lqstats` tool that lets you use the bus to see the
current long-term stats. This is very barebones, but will
provide a tool allowing stat extraction for inclusion in
external stats collectors (such as Zabbix), if you aren't
using the long-term stats server we're developing.
Requested by D. Denson.
Now that the UISP network tree is built as a spanning tree, with 10
cost per hop we can reliably flip the tree from A->B->C to C->B->A
depending upon root positioning.
This addition allows you to specify additional routes (that MUST
exist!) e.g. A->C and specify a cost to use instead of the default
10. This allows for topologies in which A-B-C is actually faster
than a direct A-C route (for example, becuase of short 60ghz
hops).
Rather than obeying the "parent" field, which leads to wrong-way up
graphs when building from a non-root site - instead build a complete
cost-based spanning tree from the specified root node. Then use
the generated tree - falling back on parent if nothing is found -
to populate the tree in order.
Tested on Herbert's network, correctly generates topology from several
different locations.
Still to come: adding a mechanism for providing parenting overloads
to allow for cases where a long path is actually optimal, but we
have no way of knowing that.