import "github.com/cockroachdb/cockroach/pkg/settings/cluster"
TelemetryOptOut is a place for controlling whether to opt out of telemetry or not.
CPUProfileType tracks whether a CPU profile is in progress.
const ( // CPUProfileNone means that no CPU profile is currently taken. CPUProfileNone CPUProfileType = iota // CPUProfileDefault means that a CPU profile is currently taken, but // pprof labels are not enabled. CPUProfileDefault // CPUProfileWithLabels means that a CPU profile is currently taken and // pprof labels are enabled. CPUProfileWithLabels )
type Settings struct { SV settings.Values // Manual defaults to false. If set, lets this ClusterSetting's MakeUpdater // method return a dummy updater that simply throws away all values. This is // for use in tests for which manual control is desired. // // Also see the Override() method that different types of settings provide for // overwriting the default of a single setting. Manual atomic.Value // bool Tracer *tracing.Tracer ExternalIODir string // Version provides the interface through which which callers read/write to // the active cluster version, and access this binary's version details. // Setting the active cluster version has a very specific, intended usage // pattern. Look towards the interface itself for more commentary. Version clusterversion.Handle // contains filtered or unexported fields }
Settings is the collection of cluster settings. For a running CockroachDB node, there is a single instance of Settings which is shared across various components.
NoSettings is used when a func requires a Settings but none is available (for example, a CLI subcommand that does not connect to a cluster).
MakeClusterSettings returns a Settings object that has its binary and minimum supported versions set to this binary's build and it's minimum supported versions respectively. The cluster version setting is not initialized.
MakeTestingClusterSettings returns a Settings object that has its binary and minimum supported versions set to the baked in binary version. It also initializes the cluster version setting to the binary version.
It is typically used for testing or one-off situations in which a Settings object is needed, but cluster settings don't play a crucial role.
func MakeTestingClusterSettingsWithVersions( binaryVersion, binaryMinSupportedVersion roachpb.Version, initializeVersion bool, ) *Settings
MakeTestingClusterSettingsWithVersions returns a Settings object that has its binary and minimum supported versions set to the provided versions. It also can also initialize the cluster version setting to the specified binaryVersion.
It is typically used in tests that want to override the default binary and minimum supported versions.
func (s *Settings) CPUProfileType() CPUProfileType
CPUProfileType returns the type of CPU profile being recorded, if any. This can be used by moving parts across the system to add profiler labels which are too expensive to be enabled at all times. If no profile is currently being recorded, returns CPUProfileNone.
MakeUpdater returns a new Updater, pre-alloced to the registry size. Note that if the Setting has the Manual flag set, this Updater simply ignores all updates.
func (s *Settings) SetCPUProfiling(to CPUProfileType) error
SetCPUProfiling is called from the pprofui to inform the system that a CPU profile is being recorded. If an error is returned, a profile was already in progress and the caller must try again later.
Package cluster imports 9 packages (graph) and is imported by 609 packages. Updated 2020-12-31. Refresh now. Tools for package owners.