-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathcluster_settings.go
47 lines (41 loc) · 1.67 KB
/
cluster_settings.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2022 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 contention
import (
"time"
"github.com/cockroachdb/cockroach/pkg/settings"
)
// TxnIDResolutionInterval is the cluster setting that controls how often the
// Transaction ID Resolution is performed.
var TxnIDResolutionInterval = settings.RegisterDurationSetting(
settings.TenantWritable,
"sql.contention.event_store.resolution_interval",
"the interval at which transaction fingerprint ID resolution is "+
"performed (set to 0 to disable)",
time.Second*30,
)
// StoreCapacity is the cluster setting that controls the
// maximum size of the contention event store.
var StoreCapacity = settings.RegisterByteSizeSetting(
settings.TenantWritable,
"sql.contention.event_store.capacity",
"the in-memory storage capacity per-node of contention event store",
64*1024*1024, // 64 MB per node.
).WithPublic()
// DurationThreshold is the cluster setting for the threshold of
// contention durations. Only the contention events whose duration exceeds the
// threshold will be collected into crdb_internal.transaction_contention_events.
var DurationThreshold = settings.RegisterDurationSetting(
settings.TenantWritable,
"sql.contention.event_store.duration_threshold",
"minimum contention duration to cause the contention events to be collected "+
"into crdb_internal.transaction_contention_events",
0,
).WithPublic()