g

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0 Imports: 6 Imported by: 217

Documentation

Index

Constants

View Source
const (
	COMMIT = "12f7b3b"
)
View Source
const (
	VERSION = "0.0.8"
)

Variables

View Source
var (
	ConfigCronCnt = nproc.NewSCounterQps("ConfigCronCnt")
	ConfigLastTs  = nproc.NewSCounterBase("ConfigLastTs")
	ConfigLastCnt = nproc.NewSCounterBase("ConfigLastCnt")

	CollectorCronCnt = nproc.NewSCounterQps("CollectorCronCnt")
	CollectorLastTs  = nproc.NewSCounterBase("CollectorLastTs")
	CollectorLastCnt = nproc.NewSCounterBase("CollectorLastCnt")
	CollectorCnt     = nproc.NewSCounterQps("CollectorCnt")

	JudgeCronCnt = nproc.NewSCounterQps("JudgeCronCnt")
	JudgeLastTs  = nproc.NewSCounterBase("JudgeLastTs")

	SenderCronCnt = nproc.NewSCounterQps("SenderCronCnt")
	SenderLastTs  = nproc.NewSCounterBase("SenderLastTs")
	SenderCnt     = nproc.NewSCounterQps("SenderCnt")
)

counter

View Source
var (
	FloodRate = nproc.NewSCounterBase("FloodRate")
	Threshold = nproc.NewSCounterBase("Threshold")
	Blocking  = nproc.NewSCounterBase("nodata.blocking")
)

flood

View Source
var (
	ConfigFile string
)

Functions

func GetAllCounters

func GetAllCounters() []interface{}

func ParseConfig

func ParseConfig(cfg string)

func StartProc

func StartProc()

Types

type CollectorConfig

type CollectorConfig struct {
	Enabled    bool  `json:"enabled"`
	Batch      int32 `json:"batch"`
	Concurrent int32 `json:"concurrent"`
}

type GlobalConfig

type GlobalConfig struct {
	Debug     bool             `json:"debug"`
	Http      *HttpConfig      `json:"http"`
	PlusApi   *PlusAPIConfig   `json:"plus_api"`
	Config    *NdConfig        `json:"config"`
	Collector *CollectorConfig `json:"collector"`
	Sender    *SenderConfig    `json:"sender"`
}

func Config

func Config() *GlobalConfig

type HttpConfig

type HttpConfig struct {
	Enabled bool   `json:"enabled"`
	Listen  string `json:"listen"`
}

type NdConfig

type NdConfig struct {
	Enabled bool   `json:"enabled"`
	Dsn     string `json:"dsn"`
	MaxIdle int32  `json:"maxIdle"`
}

type PlusAPIConfig

type PlusAPIConfig struct {
	Addr           string `json:"addr"`
	Token          string `json:"token"`
	ConnectTimeout int32  `json:"connectTimeout"`
	RequestTimeout int32  `json:"requestTimeout"`
}

type SenderConfig

type SenderConfig struct {
	Enabled        bool   `json:"enabled"`
	TransferAddr   string `json:"transferAddr"`
	ConnectTimeout int32  `json:"connectTimeout"`
	RequestTimeout int32  `json:"requestTimeout"`
	Batch          int32  `json:"batch"`
}

Jump to

Keyboard shortcuts

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