chantrack

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

README

Chan Track

Keep track of how your channel buffers evolve over time.

If they are always full it means your producers are faster than then consumers, and this might lead to issues.

Documentation

Overview

Package chantrack allows to keep track of channels buffers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Make

func Make[T any](size int) chan T

Make should be used instead of the builtin make to construct channels to track.

Types

type Report

type Report struct {
	// MakeCallLocation is the callsite of Make that caused the channel to be
	// constructed and tracked.
	MakeCallLocation string
	Len, Cap         int
}

Report contains info about a channel.

func Sample

func Sample() []Report

Sample takes a sample of the currently tracked channels.

Jump to

Keyboard shortcuts

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