cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

rac2: add token counter and stream metrics

Open kvoli opened this issue 1 year ago • 4 comments

This commit introduces metrics related to stream eval tokens and stream send tokens. Hooking up these metrics to the registry will be in a subsequent commit.

There are two separate metric structs used:

  1. tokenCounterMetrics, which only contains counter and is shared among all tokenCounters on the same node. Each tokenCounter updates the shared counters after adjust is called.
  2. tokenStreamMetrics, which is updated periodically by calling UpdateMetricGauges via the StreamTokenCounterProvider, which is one per node.

Metrics related to WaitForEval (as well as blocked stream logging) are also deferred to a subsequent commit.

Part of: https://github.com/cockroachdb/cockroach/issues/128031 Release note: None

kvoli avatar Aug 20 '24 19:08 kvoli

Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

blathers-crl[bot] avatar Aug 20 '24 19:08 blathers-crl[bot]

This change is Reviewable

cockroach-teamcity avatar Aug 20 '24 19:08 cockroach-teamcity

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

blathers-crl[bot] avatar Aug 22 '24 14:08 blathers-crl[bot]

Open to suggestions for the migration. I was planning on just hooking these up and having both metrics be enabled at once. We could reuse the existing metrics with some heavy refactoring, if that were desirable.

kvoli avatar Aug 26 '24 22:08 kvoli

Should be ready for another look @sumeerbhola.

kvoli avatar Aug 29 '24 17:08 kvoli

TYFTR!

bors r=sumeerbhola

kvoli avatar Aug 30 '24 15:08 kvoli