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(logger logrus.FieldLogger, fs afero.Fs, fname string) (*Collector, error)

    New return new JSON collector

    func (*Collector) Collect

    func (c *Collector) Collect(scs []stats.SampleContainer)

    func (*Collector) GetRequiredSystemTags

    func (c *Collector) GetRequiredSystemTags() stats.SystemTagSet

      GetRequiredSystemTags returns which sample tags are needed by this collector

      func (*Collector) HandleMetric

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

      func (*Collector) HasSeenMetric

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

      func (*Collector) Init

      func (c *Collector) Init() error
      func (c *Collector) Link() string

      func (*Collector) Run

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

      func (*Collector) SetRunStatus

      func (c *Collector) SetRunStatus(status lib.RunStatus)

      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  *stats.SampleTags `json:"tags"`
      }

      func NewJSONSample

      func NewJSONSample(sample *stats.Sample) *JSONSample