json

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

func New

func New(fname string, fs afero.Fs, opts lib.Options) (*Collector, error)

func (*Collector) Collect

func (c *Collector) Collect(samples []stats.Sample)

func (*Collector) HandleMetric

func (c *Collector) HandleMetric(m *stats.Metric)

func (*Collector) HasSeenMetric

func (c *Collector) HasSeenMetric(str string) bool

func (*Collector) Init added in v0.12.2

func (c *Collector) Init()

func (*Collector) Run

func (c *Collector) Run(ctx context.Context)

func (*Collector) String

func (c *Collector) String() string

type Envelope

type Envelope struct {
	Type   string      `json:"type"`
	Data   interface{} `json:"data"`
	Metric string      `json:"metric,omitempty"`
}

func WrapMetric

func WrapMetric(metric *stats.Metric) *Envelope

func WrapSample

func WrapSample(sample *stats.Sample) *Envelope

type JSONSample

type JSONSample struct {
	Time  time.Time         `json:"time"`
	Value float64           `json:"value"`
	Tags  map[string]string `json:"tags"`
}

func NewJSONSample

func NewJSONSample(sample *stats.Sample) *JSONSample

Jump to

Keyboard shortcuts

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