g

package
v0.0.0-...-5416f79 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

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 BlockConfig

type BlockConfig struct {
	Enabled        bool    `json:"enabled"`
	Threshold      int32   `json:"threshold"`
	SetBlock       bool    `json:"setBlock"`
	EnableGauss    bool    `json:"enableGauss"`
	Hostname       string  `json:"hostname"`
	FloodCounter   string  `json:"floodCounter"`
	GaussFilter    float64 `json:"gaussFilter"`
	Gauss3SigmaMin float64 `json:"gauss3SigmaMin"`
	Gauss3SigmaMax float64 `json:"gauss3SigmaMax"`
}

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"`
	Query     *QueryConfig     `json:"query"`
	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 QueryConfig

type QueryConfig struct {
	QueryAddr      string `json:"queryAddr"`
	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"`
	Block          *BlockConfig `json:"block"`
}

Jump to

Keyboard shortcuts

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