goddd

package
v0.0.0-...-a1d7b1b Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MetricList = []string{
	"api_booking_service_request_count",
	"api_booking_service_request_latency_microseconds",
	"go_gc_duration_seconds",
	"go_goroutines",
	"go_memstats_alloc_bytes",
	"go_memstats_alloc_bytes_total",
	"go_memstats_buck_hash_sys_bytes",
	"go_memstats_frees_total",
	"go_memstats_gc_sys_bytes",
	"go_memstats_heap_alloc_bytes",
	"go_memstats_heap_idle_bytes",
	"go_memstats_heap_inuse_bytes",
	"go_memstats_heap_objects",
	"go_memstats_heap_released_bytes_total",
	"go_memstats_heap_sys_bytes",
	"go_memstats_last_gc_time_seconds",
	"go_memstats_lookups_total",
	"go_memstats_mallocs_total",
	"go_memstats_mcache_inuse_bytes",
	"go_memstats_mcache_sys_bytes",
	"go_memstats_mspan_inuse_bytes",
	"go_memstats_mspan_sys_bytes",
	"go_memstats_next_gc_bytes",
	"go_memstats_other_sys_bytes",
	"go_memstats_stack_inuse_bytes",
	"go_memstats_stack_sys_bytes",
	"go_memstats_sys_bytes",
	"http_request_duration_microseconds",
	"http_request_size_bytes",
	"http_requests_total",
	"http_response_size_bytes",
	"process_cpu_seconds_total",
	"process_max_fds",
	"process_open_fds",
	"process_resident_memory_bytes",
	"process_start_time_seconds",
	"process_virtual_memory_bytes",
}

MetricList list of metrics from go-kit

View Source
var MultiGroupsMetricList = []string{
	"api_booking_service_request_count",
	"api_booking_service_request_latency_microseconds",
}

MultiGroupsMetricList list of metrics that needs an extra "total" tag

Functions

This section is empty.

Types

type CacheType

type CacheType struct {
	CounterType map[string]CounterCache `json:"counterType"`
}

Cache the structure of json file for cache

func NewCache

func NewCache() *CacheType

NewCache return an object of CacheType

func (CacheType) MarshalEasyJSON

func (v CacheType) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CacheType) MarshalJSON

func (v CacheType) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CacheType) UnmarshalEasyJSON

func (v *CacheType) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CacheType) UnmarshalJSON

func (v *CacheType) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CounterCache

type CounterCache struct {
	Pre float64 `json:"pre"`
}

CounterCache struct to store counter type data

func (CounterCache) MarshalEasyJSON

func (v CounterCache) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CounterCache) MarshalJSON

func (v CounterCache) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CounterCache) UnmarshalEasyJSON

func (v *CounterCache) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CounterCache) UnmarshalJSON

func (v *CounterCache) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GodddCollector

type GodddCollector struct {
	Downloader MetricsDownloader
	// contains filtered or unexported fields
}

GodddCollector struct

func New

func New() (*GodddCollector, error)

New return an instance of Goddd

func (*GodddCollector) CollectMetrics

func (c *GodddCollector) CollectMetrics(mts []snap.Metric) ([]snap.Metric, error)

CollectMetrics will be called by Snap when a task that collects one of the metrics returned from this plugins

func (*GodddCollector) GetMetricTypes

func (c *GodddCollector) GetMetricTypes(cfg snap.Config) ([]snap.Metric, error)

GetMetricTypes returns metric types for testing

type HTTPMetricsDownloader

type HTTPMetricsDownloader struct {
}

func (HTTPMetricsDownloader) GetEndpoint

func (downloader HTTPMetricsDownloader) GetEndpoint(config snap.Config) (string, error)

func (HTTPMetricsDownloader) GetMetricsReader

func (downloader HTTPMetricsDownloader) GetMetricsReader(url string) (io.Reader, error)

type LabelStruct

type LabelStruct struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

LabelStruct smallest unit of label of metric

func (LabelStruct) MarshalEasyJSON

func (v LabelStruct) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (LabelStruct) MarshalJSON

func (v LabelStruct) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*LabelStruct) UnmarshalEasyJSON

func (v *LabelStruct) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*LabelStruct) UnmarshalJSON

func (v *LabelStruct) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type MetricsDownloader

type MetricsDownloader interface {
	GetMetricsReader(url string) (io.Reader, error)
	GetEndpoint(config snap.Config) (string, error)
}

type Summary

type Summary struct {
	SampleCount uint64         `json:"sampleCount"`
	SampleSum   float64        `json:"sampleSum"`
	Quantile050 float64        `json:"quantile050"`
	Quantile090 float64        `json:"quantile090"`
	Quantile099 float64        `json:"quantile099"`
	Label       []*LabelStruct `json:"label"`
}

Summary a container to encode the summary type's metric from goddd / go-kit

func (Summary) MarshalEasyJSON

func (v Summary) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Summary) MarshalJSON

func (v Summary) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Summary) UnmarshalEasyJSON

func (v *Summary) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Summary) UnmarshalJSON

func (v *Summary) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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