config

package
v0.0.0-...-6327341 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDoctorConfigDirectory          = "~/.kava/doctor"
	DoctorConfigEnvironmentVariablePrefix = "DOCTOR"
	// use snake_casing to match json or
	// environment variable provided configuration
	ConfigFilepathFlagName                             = "config_filepath"
	DefaultMonitoringIntervalSecondsFlagName           = "default_monitoring_interval_seconds"
	KavaAPIAddressFlagName                             = "kava_api_address"
	MaxMetricSamplesToRetainPerNodeFlagName            = "max_metric_samples_to_retain_per_node"
	MetricSamplesForSyntheticMetricCalculationFlagName = "metric_samples_to_use_for_synthetic_metrics"
	MetricCollectorsFlagName                           = "metric_collectors"
	DefaultMetricCollector                             = "file"
	FileMetricCollector                                = "file"
	CloudwatchMetricCollector                          = "cloudwatch"
	AWSRegionFlagName                                  = "aws_region"
	MetricNamespaceFlagName                            = "metric_namespace"
	AutohealFlagName                                   = "autoheal"
	AutohealBlockchainServiceNameFlagName              = "autoheal_blockchain_service_name"
	AutohealSyncLatencyToleranceSecondsFlagName        = "autoheal_sync_latency_tolerance_seconds"
	AutohealSyncToLiveToleranceSecondsFlagName         = "autoheal_sync_to_live_tolerance_seconds"
	DowntimeRestartThresholdSecondsFlagName            = "downtime_restart_threshold_seconds"
	// 5 minutes
	DefaultDowntimeRestartThresholdSeconds     = 300
	NoNewBlocksRestartThresholdSecondsFlagName = "no_new_blocks_restart_threshold_seconds"
	// 5 minutes
	DefaultNoNewBlocksRestartThresholdSeconds = 300
	AutohealChecksStartupDelaySecondsFlagName = "autoheal_checks_startup_delay_seconds"
	// 45 minutes
	DefaultAutohealChecksStartupDelaySecondsFlag = 2700
	HealthChecksTimeoutSecondsFlagName           = "health_check_timeout_seconds"
	DefaultHealthChecksTimeoutSecondsFlagName    = 10
	AutohealRestartDelaySecondsFlagName          = "autoheal_restart_delay_seconds"
	// 45 minutes
	DefaultAutohealRestartDelaySeconds = 2700
)
View Source
const (
	DefaultMetricSamplesToKeepPerNode                 = 10000
	DefaultMetricSamplesForSyntheticMetricCalculation = 60
)

Variables

View Source
var (
	ValidMetricCollectors = []string{
		FileMetricCollector,
		CloudwatchMetricCollector,
	}
)

Functions

This section is empty.

Types

type DoctorConfig

type DoctorConfig struct {
	KavaNodeRPCURL                             string
	InteractiveMode                            bool
	DebugMode                                  bool
	DefaultMonitoringIntervalSeconds           int
	MaxMetricSamplesToRetainPerNode            int
	MetricSamplesForSyntheticMetricCalculation int
	MetricCollectors                           []string
	AWSRegion                                  string
	MetricNamespace                            string
	Logger                                     *log.Logger
	Autoheal                                   bool
	AutohealBlockchainServiceName              string
	AutohealSyncLatencyToleranceSeconds        int
	AutohealSyncToLiveToleranceSeconds         int
	AutohealRestartDelaySeconds                int
	HealthChecksTimeoutSeconds                 int
	NoNewBlocksRestartThresholdSeconds         int
	DowntimeRestartThresholdSeconds            int
}

DoctorConfig wraps values used to configure the execution of the doctor program

func GetDoctorConfig

func GetDoctorConfig() (*DoctorConfig, error)

GetDoctorConfig gets an instance of DoctorConfig populated with values provided via the command line environment, and or config files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL