metrics

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package metrics counts what the engine does, without any metrics library: the embedding application exports the snapshot however it likes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type M

type M struct {
	Commands       atomic.Int64
	Conflicts      atomic.Int64
	EventsAppended atomic.Int64
	DeadLetters    atomic.Int64
	JobsDispatched atomic.Int64
	CacheHits      atomic.Int64
	Timers         atomic.Int64
	Archived       atomic.Int64
	Deleted        atomic.Int64
	// LatencyNanos accumulates command handling time (decide + append).
	LatencyNanos atomic.Int64
}

M holds the counters of one engine.

func (*M) Snapshot

func (m *M) Snapshot() Snapshot

Snapshot returns the current values.

type Snapshot

type Snapshot struct {
	Commands       int64 `json:"commands"`
	Conflicts      int64 `json:"conflicts"`
	EventsAppended int64 `json:"events_appended"`
	DeadLetters    int64 `json:"dead_letters"`
	JobsDispatched int64 `json:"jobs_dispatched"`
	CacheHits      int64 `json:"cache_hits"`
	Timers         int64 `json:"timers"`
	Archived       int64 `json:"archived"`
	Deleted        int64 `json:"deleted"`
	LatencyNanos   int64 `json:"latency_nanos"`
	// ProjectionLag is the number of events not yet processed by the
	// dispatcher (filled by the engine on request).
	ProjectionLag uint64 `json:"projection_lag"`
	// DispatchStall is the longest time any dispatcher partition with pending
	// events has gone without acknowledging one; DispatchStalls has it per
	// partition. The dispatcher retries transient failures forever, so this
	// is the signal to alert on (e.g. above one minute).
	DispatchStall  time.Duration         `json:"dispatch_stall"`
	DispatchStalls map[int]time.Duration `json:"dispatch_stalls,omitempty"`
}

Snapshot is a point-in-time copy of the counters.

Jump to

Keyboard shortcuts

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