report

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressWithGzip

func CompressWithGzip(data io.Reader) (io.Reader, error)

CompressWithGzip takes an io.Reader as input and pipes it through a gzip.Writer returning an io.Reader containing the gzipped data. An error is returned if passing data to the gzip.Writer fails

func NewReportWrite

func NewReportWrite(capacity int) *reportWrite

Types

type BulkAction

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

func (*BulkAction) Push

func (b *BulkAction) Push(request Metrics) error

type BulkMetricRequest

type BulkMetricRequest []*Metric

func CreateBulkMetricRequest

func CreateBulkMetricRequest() *BulkMetricRequest

func (*BulkMetricRequest) Add

func (b *BulkMetricRequest) Add(name string, tags map[string]string, fields map[string]interface{}) *BulkMetricRequest

func (*BulkMetricRequest) AddWithTime

func (b *BulkMetricRequest) AddWithTime(name string, tags map[string]string, fields map[string]interface{}, timestamp time.Time) *BulkMetricRequest

type CollectorConfig

type CollectorConfig struct {
	Addr     string `file:"addr" env:"COLLECTOR_ADDR" default:"collector:7076"`
	UserName string `file:"username" env:"COLLECTOR_AUTH_USERNAME"`
	Password string `file:"password" env:"COLLECTOR_AUTH_PASSWORD"`
	Retry    int    `file:"retry" env:"TELEMETRY_REPORT_STRICT_RETRY" default:"3"`
}

type Disruptor

type Disruptor interface {
	In(metrics ...*Metric) error
}

type GlobalLabel

type GlobalLabel map[string]string

type Metric

type Metric struct {
	Name      string                 `json:"name"`
	Timestamp int64                  `json:"timestamp"`
	Tags      map[string]string      `json:"tags"`
	Fields    map[string]interface{} `json:"fields"`
}

type MetricReport

type MetricReport interface {
	SetCFG(cfg *config)
	Send(in []*Metric) error
	CreateReportClient(addr, username, password string) *ReportClient
}

type Metrics

type Metrics []*Metric

type NamedMetrics

type NamedMetrics struct {
	Name    string
	Metrics Metrics
}

type ReportClient

type ReportClient struct {
	CFG        *config
	HttpClient *http.Client
}

func (*ReportClient) CreateReportClient

func (c *ReportClient) CreateReportClient(addr, username, password string) *ReportClient

func (*ReportClient) Send

func (c *ReportClient) Send(in []*Metric) error

func (*ReportClient) SetCFG

func (c *ReportClient) SetCFG(cfg *config)

type ReportConfig

type ReportConfig struct {
	Mode    string `file:"mode" default:"performance"`
	UdpHost string `file:"udp_host" env:"HOST_IP" default:"localhost"`
	UdpPort string `file:"upd_port" env:"HOST_PORT" default:"7082"`

	Collector CollectorConfig `file:"collector"`

	BufferSize int `file:"buffer_size" env:"REPORT_BUFFER_SIZE" default:"200"`
}

type ReportMode

type ReportMode string

type Reporter

type Reporter interface {
	Send(metrics []*Metric) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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