cat

package
v2.1.9+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS = "0"
	ERROR   = "-1"
	FAIL    = "fail"
)
View Source
const (
	CatContextRootMessageId    = "_catRootMessageId"
	CatContextParentMessageId  = "_catParentMessageId"
	CatContextChildMessageId   = "_catChildMessageId"
	CatContextClientDomainName = "_catClientDomainName"
)
View Source
const (
	GoCatVersion = "2.0.0"
)

Variables

View Source
var Manager = catMessageManager{
	// contains filtered or unexported fields
}

Functions

func AddMonitorCollector

func AddMonitorCollector(collector Collector)

func DebugOn

func DebugOn()

func Init

func Init(domain string)

func InitWithConfig

func InitWithConfig(domain string, cfg XMLConfig)

func InitWithLocation

func InitWithLocation(domain, location string)

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 NewTransactionWithContext

func NewTransactionWithContext(ctx context.Context, 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
	Fetch(os *OSInfo) error
}

type Config

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

func (*Config) Init

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

func (*Config) InitWithConfig

func (config *Config) InitWithConfig(domain string, cfg XMLConfig) (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) 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 OSInfo

type OSInfo struct {
	Name                string `xml:"name,attr"`
	Arch                string `xml:"arch,attr"`
	Version             string `xml:"version,attr"`
	AvailableProcessors string `xml:"available-processors,attr"`
	SystemLoadAverage   string `xml:"system-load-average,attr"`
	//ProcessTime         string `xml:"process-time"`
	TotalPhysicalMemory    string `xml:"total-physical-memory,attr"`
	FreePhysicalMemory     string `xml:"free-physical-memory,attr"`
	CommittedVirtualMemory string `xml:"committed-virtual-memory,attr"`
	TotalSwapSpace         string `xml:"total-swap-space,attr"`
	FreeSwapSpace          string `xml:"free-swap-space,attr"`
}

type XMLConfig

type XMLConfig struct {
	Name       xml.Name         `xml:"config"`
	Env        string           `xml:"env"`
	Router     string           `xml:"router"`
	BaseLogDir string           `xml:"base-log-dir"`
	Servers    XMLConfigServers `xml:"servers"`
}

type XMLConfigServer

type XMLConfigServer struct {
	Host     string `xml:"ip,attr"`
	Port     int    `xml:"port,attr"`
	HttpPort int    `xml:"http-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