statistics

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright [2019] housepower

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ConsumeMsgsTotal = ParseMsgsErrorTotal + FlushMsgsTotal + FlushMsgsErrorTotal
	ConsumeMsgsTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: prefix + "consume_msgs_total",
			Help: "total num of consumed msgs",
		},
		[]string{"task"},
	)
	ParseMsgsErrorTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: prefix + "parse_msgs_error_total",
			Help: "total num of msgs with parse failure",
		},
		[]string{"task"},
	)
	FlushMsgsTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: prefix + "flush_msgs_total",
			Help: "total num of flushed msgs",
		},
		[]string{"task"},
	)
	FlushMsgsErrorTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: prefix + "flush_msgs_error_total",
			Help: "total num of msgs failed to flush to ck",
		},
		[]string{"task"},
	)
	ConsumeOffsets = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: prefix + "consume_offsets",
			Help: "last committed offset for each topic partition pair",
		},
		[]string{"consumer", "topic", "partition"},
	)
	ConsumeLags = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: prefix + "consume_lags",
			Help: "message lags for each task, work with cluster of sinker",
		},
		[]string{"consumer", "topic", "task"},
	)
	ShardMsgs = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: prefix + "shard_msgs",
			Help: "num of msgs in shard",
		},
		[]string{"task"},
	)
	WritingPoolBacklog = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: prefix + "writing_pool_backlog",
			Help: "GlobalWritingPool backlog",
		},
		[]string{"task"},
	)
	WritingDurations = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    prefix + "writing_durations",
			Help:    "writing durations",
			Buckets: []float64{1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0},
		},
		[]string{"task", "table"},
	)
	WriteSeriesAllowNew = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: prefix + "write_series_allow_new",
			Help: "num of allowed new series",
		},
		[]string{"task"},
	)
	WriteSeriesAllowChanged = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: prefix + "write_series_allow_changed",
			Help: "num of allowed changed series",
		},
		[]string{"task"},
	)
	WriteSeriesDropQuota = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: prefix + "write_series_drop_quota",
			Help: "num of disallowed write_series due to quota",
		},
		[]string{"task"},
	)
	WriteSeriesDropUnchanged = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: prefix + "write_series_drop_unchanged",
			Help: "num of disallowed write_series due to unchanged",
		},
		[]string{"task"},
	)
	// WriteSeriesSucceed = WriteSeriesAllowNew + WriteSeriesAllowChanged
	WriteSeriesSucceed = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: prefix + "write_series_succeed",
			Help: "num of series handled by writeSeries",
		},
		[]string{"task"},
	)
)

Functions

This section is empty.

Types

type Pusher

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

Pusher is the service to push the metrics to pushgateway

func NewPusher

func NewPusher(addrs []string, interval int, selfAddr string) *Pusher

func (*Pusher) Init

func (p *Pusher) Init() error

func (*Pusher) Run

func (p *Pusher) Run()

func (*Pusher) Stop

func (p *Pusher) Stop()

Jump to

Keyboard shortcuts

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