metrics

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNamespaceCreatorUnsupported = errors.New("wrapped arctable does not support namespace creation")

ErrNamespaceCreatorUnsupported is returned when a wrapped ArcTable cannot create namespaces.

View Source
var ErrParentLookupUnsupported = errors.New("wrapped arctable does not support parent lookup")

ErrParentLookupUnsupported is returned when a wrapped ArcTable cannot read root parents.

Functions

This section is empty.

Types

type ArcTable

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

ArcTable wraps an arctable.ArcTable and records evaluation counters.

func NewArcTable

func NewArcTable(base arctable.ArcTable) *ArcTable

NewArcTable wraps base with ArcTable operation counters.

func (*ArcTable) Base

func (m *ArcTable) Base() arctable.ArcTable

Base returns the wrapped ArcTable implementation.

func (*ArcTable) BatchGet

func (m *ArcTable) BatchGet(ctx context.Context, namespace string, root cid.Cid, paths []arcset.Path) (map[arcset.Path]cid.Cid, error)

BatchGet retrieves multiple target CIDs in a single operation.

func (*ArcTable) Close

func (m *ArcTable) Close() error

Close releases resources.

func (*ArcTable) CreateNamespace

func (m *ArcTable) CreateNamespace(ctx context.Context, namespace string, cfg *bloom.NamespaceConfig) error

CreateNamespace forwards namespace creation when the wrapped ArcTable supports it.

func (*ArcTable) Get

func (m *ArcTable) Get(ctx context.Context, namespace string, root cid.Cid, path arcset.Path) (cid.Cid, error)

Get retrieves the target CID for (namespace, root, path).

func (*ArcTable) GetParent

func (m *ArcTable) GetParent(ctx context.Context, namespace string, version cid.Cid) (cid.Cid, error)

GetParent forwards version-parent lookups when the wrapped ArcTable supports it.

func (*ArcTable) Iterate

func (m *ArcTable) Iterate(ctx context.Context, namespace string, root cid.Cid) arcset.Iterator

Iterate returns a streaming iterator over arcs for a given root.

func (*ArcTable) ResetStats

func (m *ArcTable) ResetStats()

ResetStats clears all ArcTable counters.

func (*ArcTable) Snapshot

func (m *ArcTable) Snapshot(ctx context.Context, namespace string, root cid.Cid) (arcset.ArcSet, error)

Snapshot returns an immutable snapshot of all arcs for a given root.

func (*ArcTable) SnapshotStats

func (m *ArcTable) SnapshotStats() ArcTableStats

SnapshotStats returns the current ArcTable counters.

func (*ArcTable) SupportsConcurrentBranches added in v0.0.2

func (m *ArcTable) SupportsConcurrentBranches() bool

SupportsConcurrentBranches forwards branching capability to the wrapped ArcTable when it advertises MVCC-style children from the same parent root.

func (*ArcTable) Update

func (m *ArcTable) Update(ctx context.Context, namespace string, newRoot, oldRoot cid.Cid, arcs arcset.ArcSet) error

Update stores arc entries with a new commitment root.

type ArcTableStats

type ArcTableStats struct {
	GetCount          uint64 `json:"get_count"`
	BatchGetCount     uint64 `json:"batch_get_count"`
	BatchGetPathCount uint64 `json:"batch_get_path_count"`
	UpdateCount       uint64 `json:"update_count"`
	UpdateArcCount    uint64 `json:"update_arc_count"`
	SnapshotCount     uint64 `json:"snapshot_count"`
	SnapshotArcCount  uint64 `json:"snapshot_arc_count"`
	IterateCount      uint64 `json:"iterate_count"`
}

ArcTableStats is a point-in-time snapshot of ArcTable operation counters.

type CASStats

type CASStats = cas.Stats

CASStats is the runtime metrics projection of storage CAS counters.

type CASStatsRecorder

type CASStatsRecorder = cas.StatsRecorder

CASStatsRecorder records CAS counters with atomic updates.

type ProofStats

type ProofStats struct {
	ProofListCount uint64 `json:"proof_list_count"`
	StepCount      uint64 `json:"step_count"`
	EvidenceBytes  uint64 `json:"evidence_bytes"`
	ProofBytes     uint64 `json:"proof_bytes"`
	TotalBytes     uint64 `json:"total_bytes"`
}

ProofStats is a point-in-time snapshot of verifier proof byte counters.

type ProofStatsRecorder

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

ProofStatsRecorder records proof-list shape and byte counters.

func (*ProofStatsRecorder) RecordProofList

func (r *ProofStatsRecorder) RecordProofList(pl prooflist.ProofList)

RecordProofList records the available byte accounting for one ProofList.

func (*ProofStatsRecorder) Reset

func (r *ProofStatsRecorder) Reset()

Reset clears all proof counters.

func (*ProofStatsRecorder) Snapshot

func (r *ProofStatsRecorder) Snapshot() ProofStats

Snapshot returns the current proof counters.

type Snapshot

type Snapshot struct {
	CAS      CASStats      `json:"cas"`
	ArcTable ArcTableStats `json:"arctable"`
	Proof    ProofStats    `json:"proof"`
}

Snapshot is a point-in-time view of node-local evaluation counters.

Jump to

Keyboard shortcuts

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