* Rework node stats a bit.
Related protocol PR - https://github.com/livekit/protocol/pull/1023
- Make a config for node stats measurements. Wanted to put the config in
`routing` package, but a circular dependency forced me to put in
config.go
- Make rate calculations explicit, i. e. requested via config.
Previously, it had some odd checks to decide when to calculate rate
and it would have been calculating over different windows.
- Report signal/data channel bytes every 5 seconds to stats collection
module. Previously, it was doing it every 30 seconds and that meant
some windows could have had a large spike
NOTE: Still need to think about this for load calculations as a large
number of participants leaving could flush in a small window and that
could report a large spike in bytes/packets. Maybe need to ignore
signal bytes for load calculation?
* deps
* use default node stats config if given config is nil
* split out node stats into a struct for re-use
* update config
tidied up list-nodes command output:
made the table narrower (to fit on the screen);
made numbers humanized;
added nodes state (useful with SHUTTING_DOWN state);
added retransmitted packets per second.
* cli: Allow setting the current node region with flag or env variable
Also add region to "starting LiveKit server" log.
* routing: Add region to node registration
Register the node's region on the selected router so it can be used for
region aware node selection.
Also add the region to the list-nodes output.
* regionaware: Set minDist to zero for the current node
If you don't set the minDist when leaving the loop early for a node that
matches the current region, the minDist value with still be at max. This
causes the the wrong node to be selected if the current node is the
first one the loop passes through.
Add a test that validates this change. The new test fails if this new
change is not in place.
* include packet and system info with node stats
* add more packet and system stats
* revert magefile, clean up system stats error handling
* update procol version
* dz review: error return
* SendData Server API
* SendData Server-API adjustments based on suggestions
* Update proto version
* enforce publishData permission
* go mod tidy
* fix go.mod
* go mod tidy
Co-authored-by: ChesterMing <89124853+ChesterMing@users.noreply.github.com>