circonus

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: BSD-3-Clause Imports: 35 Imported by: 0

Documentation

Overview

Package circonus contains methods for interfacing with circonus

Index

Constants

View Source
const (
	// MetricTypeInt32 reconnoiter
	MetricTypeInt32 = "i"

	// MetricTypeUint32 reconnoiter
	MetricTypeUint32 = "I"

	// MetricTypeInt64 reconnoiter
	MetricTypeInt64 = "l"

	// MetricTypeUint64 reconnoiter
	MetricTypeUint64 = "L"

	// MetricTypeFloat64 reconnoiter
	MetricTypeFloat64 = "n"

	// MetricTypeString reconnoiter
	MetricTypeString = "s"

	// MetricTypeHistogram reconnoiter
	MetricTypeHistogram = "h"

	// MetricTypeCumulativeHistogram reconnoiter
	MetricTypeCumulativeHistogram = "H"

	// MaxTags reconnoiter will accept in stream tagged metric name
	MaxTags = 256 // sync w/MAX_TAGS https://github.com/circonus-labs/reconnoiter/blob/master/src/noit_metric.h#L41

	// MaxMetricNameLen reconnoiter will accept (name+stream tags)
	MaxMetricNameLen = 4096 // sync w/MAX_METRIC_TAGGED_NAME https://github.com/circonus-labs/reconnoiter/blob/master/src/noit_metric.h#L40
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

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

func NewCheck

func NewCheck(parentLogger zerolog.Logger, cfg *config.Circonus) (*Check, error)

func (*Check) QueueMetricSample

func (c *Check) QueueMetricSample(
	metrics map[string]MetricSample,
	metricName,
	metricType string,
	streamTags,
	measurementTags []string,
	value interface{},
	timestamp *time.Time) error

QueueMetricSample to queue for submission

func (*Check) ResetSubmitStats

func (c *Check) ResetSubmitStats()

func (*Check) StreamMetrics

func (c *Check) StreamMetrics() bool

StreamMetrics indicates whether to stream metrics (use when multiple samples for same metric name with different timestamps)

func (*Check) SubmitQueue

func (c *Check) SubmitQueue(metrics map[string]MetricSample, resultLogger zerolog.Logger) error

func (*Check) SubmitStats

func (c *Check) SubmitStats() Stats

func (*Check) SubmitStream

func (c *Check) SubmitStream(metrics io.Reader, resultLogger zerolog.Logger) error

SubmitStream sends metrics to a circonus trap

func (*Check) UseCompression

func (c *Check) UseCompression() bool

UseCompression indicates whether the data being sent should be compressed

func (*Check) WriteMetricSample

func (c *Check) WriteMetricSample(
	metricDest io.Writer,
	metricName,
	metricType string,
	streamTags,
	measurementTags []string,
	value interface{},
	timestamp *time.Time) error

WriteMetricSample to queue for submission

type MetricSample

type MetricSample struct {
	Value     interface{} `json:"_value"`
	Type      string      `json:"_type"`
	Timestamp uint64      `json:"_ts,omitempty"`
}

type Stats

type Stats struct {
	Total     uint64
	Accepted  uint64
	Filtered  uint64
	SentBytes uint64
	SentSize  string
}

type Tag

type Tag struct {
	Category string
	Value    string
}

Tag defines an individual tag

type Tags

type Tags []Tag

Tags defines a list of tags

type TrapResult

type TrapResult struct {
	CheckUUID  string
	SubmitUUID uuid.UUID
	Stats      uint64 `json:"stats"`
	Filtered   uint64 `json:"filtered"`
	Error      string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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