stats

package
v0.0.0-...-4623b9b Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

View Source
const (
	EnvCFInstanceIndex = "CF_INSTANCE_INDEX"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

type Stats struct {
	Consume       uint64  `json:"consume"`
	ConsumePerSec float64 `json:"consume_per_sec"`
	ConsumeFail   uint64  `json:"consume_fail"`

	Publish       uint64  `json:"publish"`
	PublishPerSec float64 `json:"publish_per_sec"`

	// This is same as the number of dropped message
	PublishFail uint64 `json:"publish_fail"`

	SlowConsumerAlert uint64 `json:"slow_consumer_alert"`

	// SubInputBuffer is used to count number of current
	// buffer on subInput.
	SubInputBuffer int64 `json:"subinupt_buffer"`

	// Delay is Consume - Pulish
	// This indicate how slow publish to kafka
	Delay uint64 `json:"delay"`

	// InstanceID is ID for nozzle instance.
	// This is used to identify stats from different instances.
	// By default, it's defaultInstanceID
	InstanceID int `json:"instance_id"`
}

Stats stores various stats infomation

func NewStats

func NewStats() *Stats

func (*Stats) Dec

func (s *Stats) Dec(statsType StatsType)

func (*Stats) Inc

func (s *Stats) Inc(statsType StatsType)

func (*Stats) Json

func (s *Stats) Json() ([]byte, error)

type StatsType

type StatsType int
const (
	Consume StatsType = iota
	ConsumeFail
	Publish
	PublishFail
	SlowConsumerAlert
	SubInputBuffer
)

Jump to

Keyboard shortcuts

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