forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: extend span statistics endpoint
Extends: cockroachdb#96223 This PR extends the implementation of our SpanStats RPC endpoint to fetch stats for multiple spans at once. By extending the endpoint, we amortize the cost of the RPC's node fanout across all requested spans, whereas previously, we were issuing a fanout per span requested. Additionally, this change batches KV layer requests for ranges fully contained by the span, instead of issuing a request per fully contained range. Release note: None https://cockroachlabs.atlassian.net/browse/DOC-1355 #Informs: cockroachdb#33316 #Epic: CRDB-8035
- Loading branch information
1 parent
427212b
commit b50ae15
Showing
17 changed files
with
860 additions
and
188 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
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,39 @@ | ||
// Copyright 2023 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package roachpb | ||
|
||
import "github.com/cockroachdb/cockroach/pkg/settings" | ||
|
||
// Put span statistics cluster settings here to avoid import cycle. | ||
|
||
const DefaultSpanStatsSpanLimit = 500 | ||
|
||
// SpanStatsBatchLimit registers the maximum number of spans allowed in a | ||
// span stats request payload. | ||
var SpanStatsBatchLimit = settings.RegisterIntSetting( | ||
settings.TenantWritable, | ||
"server.span_stats.span_batch_limit", | ||
"the maximum number of spans allowed in a request payload for span statistics", | ||
DefaultSpanStatsSpanLimit, | ||
settings.PositiveInt, | ||
) | ||
|
||
const defaultRangeStatsBatchLimit = 100 | ||
|
||
// RangeStatsBatchLimit registers the maximum number of ranges to be batched | ||
// when fetching range stats for a span. | ||
var RangeStatsBatchLimit = settings.RegisterIntSetting( | ||
settings.TenantWritable, | ||
"server.span_stats.range_batch_limit", | ||
"the maximum batch size when fetching ranges statistics for a span", | ||
defaultRangeStatsBatchLimit, | ||
settings.PositiveInt, | ||
) |
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
Oops, something went wrong.