solomon

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// JobQueue is channel from with workers consume jobs
	JobQueue = make(chan Job, 5)
)

Functions

func StartWorkers added in v0.8.1

func StartWorkers(j chan Job, retryInterval int)

StartWorkers run predefined number of workers, workers wait on channel JobQueue

Types

type Config added in v0.9.0

type Config struct {
	API     string   `codec:"api"`
	Project string   `codec:"project"`
	Cluster string   `codec:"cluster"`
	Service string   `codec:"service"`
	Timeout int      `codec:"timeout"`
	Fields  []string `codec:"Fields"`
	Schema  []string `codec:"schema"`
}

Config contains setting from combainers sender section

type Job added in v0.8.1

type Job struct {
	PushData []byte
	SolCli   *Sender
}

Job contains sender and PushData

type Sender added in v0.9.0

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

Sender object

func NewSender added in v0.9.0

func NewSender(config Config, log *logrus.Entry) (*Sender, error)

NewSender return new instance of solomon sender

func (*Sender) Send added in v0.9.0

func (s *Sender) Send(task []*senders.Payload, timestamp int64) error

Send parse data, build and send http request to solomon api

type Sensor added in v1.8.0

type Sensor struct {
	Labels map[string]string `json:"labels"`
	Ts     int64             `json:"ts"`
	Value  float64           `json:"value"`
}

Sensor type

type Worker added in v0.8.1

type Worker struct {
	Retry         int           // count
	RetryInterval time.Duration // ms
	// contains filtered or unexported fields
}

Worker consume jobs from JobQueue and try run Send method of Senders

Jump to

Keyboard shortcuts

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