Skip to content

Reworking node stats a bit.#1023

Merged
boks1971 merged 3 commits intomainfrom
raja_stats
Mar 26, 2025
Merged

Reworking node stats a bit.#1023
boks1971 merged 3 commits intomainfrom
raja_stats

Conversation

@boks1971
Copy link
Copy Markdown
Contributor

  • Introducing a rate shape that captures rate of different metrics in a given interval. The interval is contained in that message.
  • Stats can have multiple rates. This is akin to reporting different window load avg in unix systems.
  • Clean up a few things o sys packets pct in rate (not sure what it was capturing) o associated prom metric (this is in server code which will come in a separate PR) (was not used anywhere internally, don't think external projects would be using it either)

- Introducing a rate shape that captures rate of different metrics in a
  given interval. The interval is contained in that message.
- Stats can have multiple rates. This is akin to reporting different
  window load avg in unix systems.
- Clean up a few things
  o sys packets pct in rate (not sure what it was capturing)
  o associated prom metric (this is in server code which will come in a
    separate PR) (was not used anywhere internally, don't
    think external projects would be using it either)
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 26, 2025

🦋 Changeset detected

Latest commit: ce58c6d

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "github.com/livekit/protocol" specified in the `fixed` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@boks1971 boks1971 requested a review from a team March 26, 2025 11:40
boks1971 added a commit to livekit/livekit that referenced this pull request Mar 26, 2025
Related protocol PR - livekit/protocol#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?
@boks1971 boks1971 merged commit fbbb1c3 into main Mar 26, 2025
5 checks passed
@boks1971 boks1971 deleted the raja_stats branch March 26, 2025 17:46
boks1971 added a commit to livekit/livekit that referenced this pull request Mar 27, 2025
* Rework node stats a bit.

Related protocol PR - livekit/protocol#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
@github-actions github-actions bot mentioned this pull request Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants