self

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2017 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Overview

Package self contains codes for recording expvastic's own metrics. Here is a list of currently collected metrics:

ElasticSearch Var Name    | expvastic var name
----------------------------------------------
Recorders                 | expRecorders
Readers                   | expReaders
Read Jobs                 | readJobs
Record Jobs               | recordJobs
Errored Jobs              | erroredJobs
Records Distributed       | recordsDistributed
DataType Objects          | datatypeObjs
DataType Objects Errors   | datatypeErrs
Unidentified JSON Count   | unidentifiedJSON
StringType Count          | stringTypeCount
FloatType Count           | floatTypeCount
GCListType Count          | gcListTypeCount
ByteType Count            | byteTypeCount
Expvar Reads              | expvarReads
ElasticSearch Records     | elasticsearchRecords

Index

Constants

This section is empty.

Variables

View Source
var IgnoredEndpoint = "http://127.0.0.1:9200"

IgnoredEndpoint is used for testing

Functions

This section is empty.

Types

type Config

type Config struct {
	SelfTypeName string `mapstructure:"type_name"`
	SelfInterval string `mapstructure:"interval"`
	SelfBackoff  int    `mapstructure:"backoff"`
	// contains filtered or unexported fields
}

Config holds the necessary configuration for setting up an self reading facility.

func FromViper

func FromViper(v *viper.Viper, log logrus.FieldLogger, name, key string) (*Config, error)

FromViper constructs the necessary configuration for bootstrapping the expvar reader

func (*Config) Backoff

func (c *Config) Backoff() int

Backoff returns the backoff

func (*Config) Endpoint

func (c *Config) Endpoint() string

Endpoint returns the endpoint

func (*Config) Interval

func (c *Config) Interval() time.Duration

Interval returns the interval

func (*Config) Logger

func (c *Config) Logger() logrus.FieldLogger

Logger returns the logger

func (*Config) Name

func (c *Config) Name() string

Name returns the name

func (*Config) NewInstance

func (c *Config) NewInstance(ctx context.Context) (reader.DataReader, error)

NewInstance instantiates a SelfReader

func (*Config) RoutePath

func (c *Config) RoutePath() string

RoutePath returns the routepath

func (*Config) Timeout

func (c *Config) Timeout() time.Duration

Timeout returns the timeout

func (*Config) TypeName added in v0.2.1

func (c *Config) TypeName() string

TypeName returns the typename

type Reader

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

Reader contains communication channels with a worker that exposes expvar information. It implements DataReader interface.

func NewReader added in v0.6.1

func NewReader(
	log logrus.FieldLogger,
	endpoint string,
	mapper datatype.Mapper,
	name,
	typeName string,
	interval time.Duration,
	timeout time.Duration,
	backoff int,
) (*Reader, error)

NewReader exposes expvastic's own metrics.

func (*Reader) Interval

func (r *Reader) Interval() time.Duration

Interval returns the interval

func (*Reader) Mapper added in v0.3.0

func (r *Reader) Mapper() datatype.Mapper

Mapper returns the mapper object

func (*Reader) Name

func (r *Reader) Name() string

Name shows the name identifier for this reader

func (*Reader) Read added in v0.6.0

func (r *Reader) Read(job context.Context) (*reader.ReadJobResult, error)

Read begins reading from the target. It sends an error back to the engine if it can't read from metrics provider

func (*Reader) Timeout

func (r *Reader) Timeout() time.Duration

Timeout returns the timeout

func (*Reader) TypeName added in v0.2.1

func (r *Reader) TypeName() string

TypeName shows the typeName the recorder should record as

Jump to

Keyboard shortcuts

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