config

package
v0.0.0-...-4e26a97 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHostname = "UnknownHost"
	DefaultEnv      = "dev"
	DefaultIp       = "127.0.0.1"
	DefaultIpHex    = "7f000001"

	TypeSystem    = "System"
	TypeHeartbeat = "Heartbeat"

	NameReboot                = "Reboot"
	NameTransactionAggregator = "TransactionAggregator"
	NameEventAggregator       = "EventAggregator"
	NameStatus                = "Status"
	NameStatusExtensionPrefix = "StatusExtension-"

	BatchFlag  = '@'
	BatchSplit = ';'

	TcpSenderHighQueueSize   = 50000
	TcpSenderNormalQueueSize = 50000

	DefaultTcpSenderNormalQueueConsumerNum = 10
	DefaultTcpSenderHighQueueConsumerNum   = 10
	TcpSenderQueueConsumerTickerDuration   = 1000 * time.Millisecond
	TcpSenderQueueConsumerBufSize          = 150

	EventAggregatorTickerDuration       = 3 * time.Second
	TransactionAggregatorTickerDuration = 3 * time.Second
	EventAggregatorChannelSize          = 1000
	TransactionAggregatorChannelSize    = 1000

	RouterUpdateDuration = 60 * time.Second
)

Variables

View Source
var (
	BinaryProtocol          = []byte("NT1")
	ThreadNameCatAgent      = []byte("cat-agent")
	ThreadGroupNameCatAgent = []byte("cat-agent-group")
)

Functions

func Init

func Init(config *Config) (err error)

func Shutdown

func Shutdown()

Types

type Config

type Config struct {
	Domain                       string   `yaml:"domain"`
	Hostname                     string   `yaml:"hostname"`
	Env                          string   `yaml:"env"`
	Ip                           string   `yaml:"ip"`
	IpHex                        string   `yaml:"ip_hex"`
	Servers                      []string `yaml:"servers"`
	SenderNormalQueueConsumerNum int      `yaml:"sender_normal_queue_consumer_num"`
	SenderHighQueueConsumerNum   int      `yaml:"sender_high_queue_consumer_num"`
}

type ConfigService

type ConfigService struct {
	// contains filtered or unexported fields
}

func GetInstance

func GetInstance() *ConfigService

func (*ConfigService) GetDomain

func (c *ConfigService) GetDomain() string

func (*ConfigService) GetEnv

func (c *ConfigService) GetEnv() string

func (*ConfigService) GetHostname

func (c *ConfigService) GetHostname() string

func (*ConfigService) GetIp

func (c *ConfigService) GetIp() string

func (*ConfigService) GetIpHex

func (c *ConfigService) GetIpHex() string

func (*ConfigService) GetRouters

func (c *ConfigService) GetRouters() []string

func (*ConfigService) GetSample

func (c *ConfigService) GetSample() float64

func (*ConfigService) GetSenderHighQueueConsumerNum

func (c *ConfigService) GetSenderHighQueueConsumerNum() int

func (*ConfigService) GetSenderNormalQueueConsumerNum

func (c *ConfigService) GetSenderNormalQueueConsumerNum() int

func (*ConfigService) GetServers

func (c *ConfigService) GetServers() []string

func (*ConfigService) IsEnabled

func (c *ConfigService) IsEnabled() bool

func (*ConfigService) RoutersCondWait

func (c *ConfigService) RoutersCondWait()

Jump to

Keyboard shortcuts

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