-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds the following metrics: - `kv.streamer.operators_count` tracks how many active streamer operators are out there currently - `kv.streamer.requests_in_progress` tracks how many BatchRequests are in flight currently, across all streamer instances - `kv.streamer.requests_throttled` tracks how many BatchRequests are being throttled (queued) due to reaching the streamer concurrency limit, across all streamer instances. Release note: None
- Loading branch information
1 parent
0c48a8e
commit 13c1da0
Showing
12 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright 2024 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the CockroachDB Software License | ||
// included in the /LICENSE file. | ||
|
||
package kvstreamer | ||
|
||
import "github.com/cockroachdb/cockroach/pkg/util/metric" | ||
|
||
var ( | ||
metaStreamerCount = metric.Metadata{ | ||
Name: "kv.streamer.operators_count", | ||
Help: "Number of KV Streamer operators currently in use", | ||
Measurement: "Operators", | ||
Unit: metric.Unit_COUNT, | ||
} | ||
metaStreamerRequestsInProgress = metric.Metadata{ | ||
Name: "kv.streamer.requests_in_progress", | ||
Help: "Number of BatchRequests in progress across all KV Streamer operators", | ||
Measurement: "Batches", | ||
Unit: metric.Unit_COUNT, | ||
} | ||
metaStreamerRequestsThrottled = metric.Metadata{ | ||
Name: "kv.streamer.requests_throttled", | ||
Help: "Number of BatchRequests currently throttled due to reaching the concurrency limit, across all KV Streamer operators", | ||
Measurement: "Batches", | ||
Unit: metric.Unit_COUNT, | ||
} | ||
) | ||
|
||
type Metrics struct { | ||
OperatorsCount *metric.Gauge | ||
RequestsInProgress *metric.Gauge | ||
RequestsThrottled *metric.Gauge | ||
} | ||
|
||
var _ metric.Struct = Metrics{} | ||
|
||
func (Metrics) MetricStruct() {} | ||
|
||
func MakeMetrics() Metrics { | ||
return Metrics{ | ||
OperatorsCount: metric.NewGauge(metaStreamerCount), | ||
RequestsInProgress: metric.NewGauge(metaStreamerRequestsInProgress), | ||
RequestsThrottled: metric.NewGauge(metaStreamerRequestsThrottled), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters