influxdb

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgentPort       = 1410
	RetentionPolicy = "default"
)
View Source
const (
	DefaultMonitorInterval = util.Duration(10 * time.Second)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DBConfig        db.Config     `yaml:"DB" mapstructure:"DB"`
	ClientConfig    client.Config `yaml:"Client" mapstructure:"Client"`
	MonitorInterval util.Duration `yaml:"MonitorInterval" mapstructure:"MonitorInterval"`
}

func NewConfig

func NewConfig() Config

type HttpBodyAddInfluxdbDatabase added in v0.0.3

type HttpBodyAddInfluxdbDatabase struct {
	NodeId   int64  `json:"node_id"`
	Database string `json:"database" validate:"min=1,max=63"`
}

type HttpBodyAddInfluxdbMetric added in v0.0.3

type HttpBodyAddInfluxdbMetric struct {
	Name        string `json:"name" validate:"min=1,max=63"`
	SeriesLimit int    `json:"series_limit"`
}

type HttpBodyAddInfluxdbMetricRoute added in v0.0.3

type HttpBodyAddInfluxdbMetricRoute struct {
	MetricId int64 `json:"metric_id"`
	NodeDBId int64 `json:"node_db_id"`
}

type HttpBodyAddInfluxdbNode added in v0.0.3

type HttpBodyAddInfluxdbNode struct {
	IP       string `json:"ip" validate:"ip"`
	HttpPort int    `json:"http_port" validate:"min=1,max=65535"`
	UdpPort  int    `json:"udp_port" validate:"min=1,max=65535"`
	DataPath string `json:"data_path" validate:"min=1,max=127"`
}

type HttpBodyAddTask added in v0.0.3

type HttpBodyAddTask struct {
	Name    string `json:"name" validate:"min=1,max=63"`
	Type    int    `json:"type"`
	Content string `json:"content" validate:"min=1,max=2048"`
}

type Service

type Service struct {
	Config Config
	DB     *db.DB

	ClientMap sync.Map
	MetricMap sync.Map

	Logger *zap.Logger

	Closing chan struct{}
	Closed  chan struct{}
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Service, error)

func (*Service) APIAddDatabase

func (s *Service) APIAddDatabase(nodeID int64, dbName string) error

func (*Service) APIAddMetric

func (s *Service) APIAddMetric(metricName string, seriesLimit int) error

func (*Service) APIAddMetricRoute

func (s *Service) APIAddMetricRoute(metricId int64, nodeDBId int64) error

func (*Service) APIAddNode

func (s *Service) APIAddNode(ip string, httpPort int, udpPort int, dataPath string) error

func (*Service) AddTask

func (s *Service) AddTask(task *HttpBodyAddTask) error

func (*Service) Close

func (s *Service) Close() error

func (*Service) GetMetricByID

func (s *Service) GetMetricByID(id int64) (*Metric, error)

func (*Service) GetNodeByID

func (s *Service) GetNodeByID(id int64) (*Node, error)

func (*Service) GetNodeDBByID

func (s *Service) GetNodeDBByID(id int64) (*NodeDB, error)

func (*Service) Open

func (s *Service) Open() error

func (*Service) Send

func (s *Service) Send(lines []byte) error

func (*Service) WithLogger

func (s *Service) WithLogger(logger *zap.Logger)

type Statistics

type Statistics struct {
	LineParseError        uint64
	LineDistributeSuccess uint64
	LineDistributeFail    uint64
}

Directories

Path Synopsis
db
Package models implements basic objects used throughout the TICK stack.
Package models implements basic objects used throughout the TICK stack.

Jump to

Keyboard shortcuts

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