cat

package
v0.0.0-...-34dcc44 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: Apache-2.0 Imports: 25 Imported by: 7

Documentation

Index

Constants

View Source
const (
	GoCatVersion       = "2.0.0"
	CatServerVersionV2 = "V2"
	CatServerVersionV3 = "V3"
)
View Source
const (
	SUCCESS = "0"
	ERROR   = "-1"
	FAIL    = "fail"
)

Variables

This section is empty.

Functions

func AddMonitorCollector

func AddMonitorCollector(collector Collector)

func CreateMessageId

func CreateMessageId() string

func DebugOn

func DebugOn()

func GetLocalhostIp

func GetLocalhostIp() (ip net.IP, err error)

获取本机IP地址, 优先从eth0, em1中取IP, 取不到,则选择默认的IP

func Init

func Init(domain string, userConfig Config)

func IsEnabled

func IsEnabled() bool

func LogError

func LogError(err error, args ...string)

func LogErrorWithCategory

func LogErrorWithCategory(err error, category string)

func LogEvent

func LogEvent(mtype, name string, args ...string)

func LogMetricForCount

func LogMetricForCount(name string, args ...int)

func LogMetricForDuration

func LogMetricForDuration(name string, duration time.Duration)

func NewCompletedTransactionWithDuration

func NewCompletedTransactionWithDuration(mtype, name string, duration time.Duration)

func NewEvent

func NewEvent(mtype, name string) message.Messager

func NewTransaction

func NewTransaction(mtype, name string) message.Transactor

func Shutdown

func Shutdown()

Types

type Buf

type Buf struct {
	bytes.Buffer
}

func (*Buf) WriteInt

func (b *Buf) WriteInt(i int) (err error)

func (*Buf) WriteUInt64

func (b *Buf) WriteUInt64(i uint64) (err error)

type Collector

type Collector interface {
	GetId() string
	GetDesc() string
	GetProperties() map[string]string
}

type Config

type Config struct {
	CatServerVersion string
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig() Config

func (*Config) Init

func (config *Config) Init(domain string, userConfig Config) (err error)

type Logger

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

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(format string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(format string, args ...interface{})

func (*Logger) SetDebug

func (l *Logger) SetDebug()

func (*Logger) Warning

func (l *Logger) Warning(format string, args ...interface{})

type MetricHelper

type MetricHelper interface {
	AddTag(key, val string) MetricHelper
	Count(int)
	Duration(time.Duration)
}

func NewMetricHelper

func NewMetricHelper(name string) MetricHelper

type XMLConfig

type XMLConfig struct {
	Name    xml.Name         `xml:"config"`
	Servers XMLConfigServers `xml:"servers"`
}

type XMLConfigServer

type XMLConfigServer struct {
	Host string `xml:"ip,attr"`
	Port int    `xml:"port,attr"`
}

type XMLConfigServers

type XMLConfigServers struct {
	Servers []XMLConfigServer `xml:"server"`
}

Jump to

Keyboard shortcuts

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