reaper

package module
v0.0.0-...-8330614 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

Reaper

Collect data from multiple instances

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithHandler

func WithHandler(handler Handler) func(*Collector)

WithHandler sets handler of collected data.

func WithLogger

func WithLogger(log Logger) func(*Collector)

WithLogger sets logger.

Types

type Batcher

type Batcher interface {
	Put(v interface{})
	Close()
}

type Collector

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

func New

func New(redis *redis.Client, opts ...Option) *Collector

func (*Collector) AsyncPush

func (c *Collector) AsyncPush(ctx context.Context, d time.Duration, labels ...string) error

func (*Collector) Close

func (c *Collector) Close()

func (*Collector) Push

func (c *Collector) Push(ctx context.Context, d time.Duration, labels ...string) error

type ErrorFunc

type ErrorFunc func(err error)

func (ErrorFunc) Error

func (f ErrorFunc) Error(err error)

type Handler

type Handler interface {
	Serve(ctx context.Context, item Item)
}

Handler handles collected messages.

type HandlerFunc

type HandlerFunc func(ctx context.Context, item Item)

func (HandlerFunc) Serve

func (f HandlerFunc) Serve(ctx context.Context, item Item)

type Item

type Item struct {
	// Duration seconds
	Duration int
	Labels   []string
}

type Logger

type Logger interface {
	Error(err error)
}

Logger handles errors.

type Option

type Option func(*Collector)

Option sets the batcher option.

Directories

Path Synopsis
examples
speed command

Jump to

Keyboard shortcuts

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