Help us shape the future of Go! Take the 2026 Go Developer Survey

iometrics

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracker

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

Tracker aggregates IO throughput metrics from multiple concurrent goroutines. Create one per operation (push/pull/fetch) and pass it to each goroutine so they share the same atomic counters.

func NewTracker

func NewTracker(operation string) *Tracker

NewTracker creates a new Tracker and records the start time. Call this before launching the errgroup.

func (*Tracker) Summary

func (t *Tracker) Summary()

Summary outputs a throughput summary to both the log file (logrus) and the terminal (stderr). Call this after all goroutines have completed (after g.Wait()) — the happens-before from errgroup guarantees all atomic stores are visible.

func (*Tracker) TrackTransfer

func (t *Tracker) TrackTransfer(fn func() error) error

TrackTransfer measures the wall-clock duration of a single transfer (one goroutine handling one blob) and accumulates it. Place this inside retry.Do so each retry attempt is measured independently.

func (*Tracker) WrapReader

func (t *Tracker) WrapReader(r io.Reader) io.Reader

WrapReader wraps an io.Reader to count bytes and accumulate Read() call durations into the shared atomic counters.

Jump to

Keyboard shortcuts

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