statistic

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 1 Imported by: ? 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 statistic collects engine throughput counters (reads, publishes, errors) as atomic counters.

Index

Constants

This section is empty.

Variables

View Source
var DefaultManager = NewManager()

DefaultManager is the default global statistics manager. It is a process-global counter sink written to by the engine, scheduler, and drivers via PushRead/PushPublish/PushError. The API layer reads its rates from engine.EngineStats, not from this package.

Functions

This section is empty.

Types

type Manager

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

Manager collects read/publish/error counters.

func NewManager

func NewManager() *Manager

NewManager creates a new Manager.

func (*Manager) PushError

func (m *Manager) PushError()

PushError increments the error counter.

func (*Manager) PushPublish

func (m *Manager) PushPublish(count int64)

PushPublish increments the publish counter.

func (*Manager) PushRead

func (m *Manager) PushRead(count int64)

PushRead increments the read counter.

func (*Manager) Snapshot

func (m *Manager) Snapshot() Snapshot

Snapshot returns a snapshot of the current counters.

type Snapshot

type Snapshot struct {
	ReadTotal    int64 `json:"read_total"`
	PublishTotal int64 `json:"publish_total"`
	ErrorTotal   int64 `json:"error_total"`
}

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

Jump to

Keyboard shortcuts

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