m3

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2017 License: MIT Imports: 12 Imported by: 56

Documentation

Index

Constants

View Source
const (
	// ServiceTag is the name of the M3 service tag.
	ServiceTag = "service"
	// EnvTag is the name of the M3 env tag.
	EnvTag = "env"
	// HostTag is the name of the M3 host tag.
	HostTag = "host"
	// DefaultMaxQueueSize is the default M3 reporter queue size.
	DefaultMaxQueueSize = 4096
	// DefaultMaxPacketSize is the default M3 reporter max packet size.
	DefaultMaxPacketSize = int32(1440)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// HostPort is the host and port of the M3 server.
	HostPort string `yaml:"hostPort" validate:"nonzero"`

	// HostPorts are the host and port of the M3 server.
	HostPorts []string `yaml:"hostPorts"`

	// Service is the service tag to that this client emits.
	Service string `yaml:"service" validate:"nonzero"`

	// Env is the env tag to use that this client emits.
	Env string `yaml:"env" validate:"nonzero"`

	// CommonTags are tags that are common for all metrics this client emits.
	CommonTags map[string]string `yaml:"tags" `

	// Queue is the maximum metric queue size of client.
	Queue int `yaml:"queue"`

	// PacketSize is the maximum packet size for a batch of metrics.
	PacketSize int32 `yaml:"packetSize"`

	// IncludeHost is whether or not to include host tag.
	IncludeHost bool `yaml:"includeHost"`
}

Configuration is a configuration for a M3 reporter.

func (Configuration) NewReporter

func (c Configuration) NewReporter() (Reporter, error)

NewReporter creates a new M3 reporter from this configuration.

type Options

type Options struct {
	HostPorts          []string
	Service            string
	Env                string
	CommonTags         map[string]string
	IncludeHost        bool
	Protocol           Protocol
	MaxQueueSize       int
	MaxPacketSizeBytes int32
	Interval           time.Duration
}

Options is a set of options for the M3 reporter.

type Protocol

type Protocol int

Protocol describes a M3 thrift transport protocol.

const (
	Compact Protocol = iota
	Binary
)

Compact and Binary represent the compact and binary thrift protocols respectively.

type Reporter

type Reporter interface {
	tally.CachedStatsReporter
	io.Closer
}

Reporter is an M3 reporter.

func NewReporter

func NewReporter(opts Options) (Reporter, error)

NewReporter creates a new M3 reporter.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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