ump

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TpMethod        = "TP"
	HeartbeatMethod = "Heartbeat"
	FunctionError   = "FunctionError"
)
View Source
const (
	FunctionTpSufixx    = "tp.log"
	SystemAliveSufixx   = "alive.log"
	BusinessAlarmSufixx = "business.log"
	LogFileOpt          = os.O_RDWR | os.O_CREATE | os.O_APPEND
	ChSize              = 102400
	BusinessAlarmType   = "BusinessAlarm"
	SystemAliveType     = "SystemAlive"
	FunctionTpType      = "FunctionTp"
	HostNameFile        = "/proc/sys/kernel/hostname"
	MaxLogSize          = 1024 * 1024 * 10
)

Variables

View Source
var (
	HostName      string
	LogTimeForMat = "20060102150405000"
	AlarmPool     = &sync.Pool{New: func() interface{} {
		return new(BusinessAlarm)
	}}
	TpObjectPool = &sync.Pool{New: func() interface{} {
		return new(TpObject)
	}}
	SystemAlivePool = &sync.Pool{New: func() interface{} {
		return new(SystemAlive)
	}}
	FunctionTpPool = &sync.Pool{New: func() interface{} {
		return new(FunctionTp)
	}}
)
View Source
var (
	FunctionTpLogWrite    = &LogWrite{logCh: make(chan interface{}, ChSize)}
	SystemAliveLogWrite   = &LogWrite{logCh: make(chan interface{}, ChSize)}
	BusinessAlarmLogWrite = &LogWrite{logCh: make(chan interface{}, ChSize)}
	UmpDataDir            = "/export/home/tomcat/UMP-Monitor/logs/"
)

Functions

func AfterTP

func AfterTP(o *TpObject, err error)

func Alarm

func Alarm(key, detail string)

func Alive

func Alive(key string)

func GetLocalIpAddr

func GetLocalIpAddr() (localAddr string, err error)

func InitUmp

func InitUmp(module, dataDir string) (err error)

Types

type BusinessAlarm

type BusinessAlarm struct {
	Time         string `json:"time"`
	Key          string `json:"key"`
	HostName     string `json:"hostname"`
	BusinessType string `json:"type"`
	Value        string `json:"value"`
	Detail       string `json:"detail"`
}

type FunctionTp

type FunctionTp struct {
	Time         string `json:"time"`
	Key          string `json:"key"`
	HostName     string `json:"hostname"`
	ProcessState string `json:"processState"`
	ElapsedTime  string `json:"elapsedTime"`
}

type LogWrite

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

type SystemAlive

type SystemAlive struct {
	Key      string `json:"key"`
	HostName string `json:"hostname"`
	Time     string `json:"time"`
}

type TpObject

type TpObject struct {
	StartTime time.Time
	EndTime   time.Time
	UmpType   interface{}
}

func BeforeTP

func BeforeTP(key string) (o *TpObject)

func NewTpObject

func NewTpObject() (o *TpObject)

Jump to

Keyboard shortcuts

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