Versions in this module Expand all Collapse all v0 v0.27.1 Jul 30, 2020 Changes in this version + const Counter + const Data + const Default + const Gauge + const Rate + const Time + const Trend + var DefaultSystemTagSet = ... + var ErrInvalidMetricType = errors.New("invalid metric type") + var ErrInvalidValueType = errors.New("invalid value type") + func D(d time.Duration) float64 + func PushIfNotDone(ctx context.Context, output chan<- SampleContainer, sample SampleContainer) bool + func ToD(d float64) time.Duration + type ConnectedSampleContainer interface + GetTags func() *SampleTags + GetTime func() time.Time + type ConnectedSamples struct + Samples []Sample + Tags *SampleTags + Time time.Time + func (cs ConnectedSamples) GetSamples() []Sample + func (cs ConnectedSamples) GetTags() *SampleTags + func (cs ConnectedSamples) GetTime() time.Time + type CounterSink struct + First time.Time + Value float64 + func (c *CounterSink) Add(s Sample) + func (c *CounterSink) Calc() + func (c *CounterSink) Format(t time.Duration) map[string]float64 + type DummySink map[string]float64 + func (d DummySink) Add(s Sample) + func (d DummySink) Calc() + func (d DummySink) Format(t time.Duration) map[string]float64 + type GaugeSink struct + Max float64 + Min float64 + Value float64 + func (g *GaugeSink) Add(s Sample) + func (g *GaugeSink) Calc() + func (g *GaugeSink) Format(t time.Duration) map[string]float64 + type Metric struct + Contains ValueType + Name string + Sink Sink + Sub Submetric + Submetrics []*Submetric + Tainted null.Bool + Thresholds Thresholds + Type MetricType + func New(name string, typ MetricType, t ...ValueType) *Metric + func (m *Metric) HumanizeValue(v float64, timeUnit string) string + func (m *Metric) Summary(t time.Duration) *Summary + type MetricType int + func (t *MetricType) UnmarshalJSON(data []byte) error + func (t MetricType) MarshalJSON() ([]byte, error) + func (t MetricType) String() string + type RateSink struct + Total int64 + Trues int64 + func (r *RateSink) Add(s Sample) + func (r RateSink) Calc() + func (r RateSink) Format(t time.Duration) map[string]float64 + type Sample struct + Metric *Metric + Tags *SampleTags + Time time.Time + Value float64 + func (s Sample) GetSamples() []Sample + func (s Sample) GetTags() *SampleTags + func (s Sample) GetTime() time.Time + type SampleContainer interface + GetSamples func() []Sample + func GetBufferedSamples(input <-chan SampleContainer) (result []SampleContainer) + type SampleTags struct + func IntoSampleTags(data *map[string]string) *SampleTags + func NewSampleTags(data map[string]string) *SampleTags + func (st *SampleTags) CloneTags() map[string]string + func (st *SampleTags) Contains(other *SampleTags) bool + func (st *SampleTags) Get(key string) (string, bool) + func (st *SampleTags) IsEmpty() bool + func (st *SampleTags) IsEqual(other *SampleTags) bool + func (st *SampleTags) MarshalJSON() ([]byte, error) + func (st *SampleTags) UnmarshalJSON(data []byte) error + type Samples []Sample + func (s Samples) GetSamples() []Sample + type Sink interface + Add func(s Sample) + Calc func() + Format func(t time.Duration) map[string]float64 + type Submetric struct + Metric *Metric + Name string + Parent string + Suffix string + Tags *SampleTags + func NewSubmetric(name string) (parentName string, sm *Submetric) + type Summary struct + Metric *Metric + Summary map[string]float64 + type SystemTagSet uint32 + const TagCheck + const TagError + const TagErrorCode + const TagGroup + const TagIP + const TagIter + const TagMethod + const TagName + const TagOCSPStatus + const TagProto + const TagScenario + const TagStatus + const TagSubproto + const TagTLSVersion + const TagURL + const TagVU + func NewSystemTagSet(tags ...SystemTagSet) *SystemTagSet + func SystemTagSetString(s string) (SystemTagSet, error) + func SystemTagSetValues() []SystemTagSet + func ToSystemTagSet(tags []string) *SystemTagSet + func (i *SystemTagSet) Add(tag SystemTagSet) + func (i *SystemTagSet) Has(tag SystemTagSet) bool + func (i *SystemTagSet) MarshalJSON() ([]byte, error) + func (i *SystemTagSet) UnmarshalJSON(data []byte) error + func (i *SystemTagSet) UnmarshalText(data []byte) error + func (i SystemTagSet) IsASystemTagSet() bool + func (i SystemTagSet) Map() TagSet + func (i SystemTagSet) SetString() string + func (i SystemTagSet) String() string + type TagSet map[string]bool + type Threshold struct + AbortGracePeriod types.NullDuration + AbortOnFail bool + LastFailed bool + Source string + type Thresholds struct + Abort bool + Runtime *goja.Runtime + Thresholds []*Threshold + func NewThresholds(sources []string) (Thresholds, error) + func (ts *Thresholds) Run(sink Sink, t time.Duration) (bool, error) + func (ts *Thresholds) UnmarshalJSON(data []byte) error + func (ts Thresholds) MarshalJSON() ([]byte, error) + type TrendSink struct + Avg float64 + Count uint64 + Max float64 + Med float64 + Min float64 + Sum float64 + Values []float64 + func (t *TrendSink) Add(s Sample) + func (t *TrendSink) Calc() + func (t *TrendSink) Format(tt time.Duration) map[string]float64 + func (t *TrendSink) P(pct float64) float64 + type ValueType int + func (t *ValueType) UnmarshalJSON(data []byte) error + func (t ValueType) MarshalJSON() ([]byte, error) + func (t ValueType) String() string