json

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2017 License: AGPL-3.0 Imports: 8 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, 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) 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