metric

package
v5.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// states used for the TableCounter labels
	TableStatePending        = "pending"
	TableStateWritten        = "written"
	TableStateClosed         = "closed"
	TableStateImported       = "imported"
	TableStateAlteredAutoInc = "altered_auto_inc"
	TableStateChecksum       = "checksum"
	TableStateCompleted      = "completed"

	// results used for the TableCounter labels
	TableResultSuccess = "success"
	TableResultFailure = "failure"

	// states used for the ChunkCounter labels
	ChunkStateEstimated = "estimated"
	ChunkStatePending   = "pending"
	ChunkStateRunning   = "running"
	ChunkStateFinished  = "finished"
	ChunkStateFailed    = "failed"

	BlockDeliverKindIndex = "index"
	BlockDeliverKindData  = "data"
)

Variables

View Source
var (
	ImporterEngineCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "lightning",
			Name:      "importer_engine",
			Help:      "counting open and closed importer engines",
		}, []string{"type"})

	IdleWorkersGauge = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: "lightning",
			Name:      "idle_workers",
			Help:      "counting idle workers",
		}, []string{"name"})

	KvEncoderCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "lightning",
			Name:      "kv_encoder",
			Help:      "counting kv open and closed kv encoder",
		}, []string{"type"},
	)

	TableCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "lightning",
			Name:      "tables",
			Help:      "count number of tables processed",
		}, []string{"state", "result"})
	ProcessedEngineCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "lightning",
			Name:      "engines",
			Help:      "count number of engines processed",
		}, []string{"state", "result"})
	ChunkCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "lightning",
			Name:      "chunks",
			Help:      "count number of chunks processed",
		}, []string{"state"})
	BytesCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "lightning",
			Name:      "bytes",
			Help:      "count of total bytes",
		}, []string{"state"})

	ImportSecondsHistogram = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: "lightning",
			Name:      "import_seconds",
			Help:      "time needed to import a table",
			Buckets:   prometheus.ExponentialBuckets(0.125, 2, 6),
		},
	)
	ChunkParserReadBlockSecondsHistogram = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: "lightning",
			Name:      "chunk_parser_read_block_seconds",
			Help:      "time needed for chunk parser read a block",
			Buckets:   prometheus.ExponentialBuckets(0.001, 3.1622776601683795, 10),
		},
	)
	ApplyWorkerSecondsHistogram = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: "lightning",
			Name:      "apply_worker_seconds",
			Help:      "time needed to apply a worker",
			Buckets:   prometheus.ExponentialBuckets(0.001, 3.1622776601683795, 10),
		}, []string{"name"},
	)
	RowReadSecondsHistogram = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: "lightning",
			Name:      "row_read_seconds",
			Help:      "time needed to parse a row",
			Buckets:   prometheus.ExponentialBuckets(0.001, 3.1622776601683795, 7),
		},
	)
	RowReadBytesHistogram = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: "lightning",
			Name:      "row_read_bytes",
			Help:      "number of bytes being read out from data source",
			Buckets:   prometheus.ExponentialBuckets(1024, 2, 8),
		},
	)
	RowEncodeSecondsHistogram = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: "lightning",
			Name:      "row_encode_seconds",
			Help:      "time needed to encode a row",
			Buckets:   prometheus.ExponentialBuckets(0.001, 3.1622776601683795, 10),
		},
	)
	RowKVDeliverSecondsHistogram = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: "lightning",
			Name:      "row_kv_deliver_seconds",
			Help:      "time needed to deliver kvs of a single row",
			Buckets:   prometheus.ExponentialBuckets(0.001, 3.1622776601683795, 10),
		},
	)
	BlockDeliverSecondsHistogram = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: "lightning",
			Name:      "block_deliver_seconds",
			Help:      "time needed to deliver a block",
			Buckets:   prometheus.ExponentialBuckets(0.001, 3.1622776601683795, 10),
		},
	)
	BlockDeliverBytesHistogram = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: "lightning",
			Name:      "block_deliver_bytes",
			Help:      "number of bytes being sent out to importer",
			Buckets:   prometheus.ExponentialBuckets(512, 2, 10),
		}, []string{"kind"},
	)
	BlockDeliverKVPairsHistogram = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: "lightning",
			Name:      "block_deliver_kv_pairs",
			Help:      "number of KV pairs being sent out to importer",
			Buckets:   prometheus.ExponentialBuckets(1, 2, 10),
		}, []string{"kind"},
	)
	ChecksumSecondsHistogram = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: "lightning",
			Name:      "checksum_seconds",
			Help:      "time needed to complete the checksum stage",
			Buckets:   prometheus.ExponentialBuckets(1, 2.2679331552660544, 10),
		},
	)

	LocalStorageUsageBytesGauge = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: "lightning",
			Name:      "local_storage_usage_bytes",
			Help:      "disk/memory size currently occupied by intermediate files in local backend",
		}, []string{"medium"},
	)
)

Functions

func ReadCounter

func ReadCounter(counter prometheus.Counter) float64

ReadCounter reports the current value of the counter.

func ReadHistogramSum

func ReadHistogramSum(histogram prometheus.Histogram) float64

ReadHistogramSum reports the sum of all observed values in the histogram.

func RecordEngineCount

func RecordEngineCount(status string, err error)

func RecordTableCount

func RecordTableCount(status string, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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