fd

package
v0.0.0-...-3b473a0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExampleHTTP

func ExampleHTTP()

ExampleHTTP is an example of HTTP exposure of Go profiles. Read more in "Efficient Go"; Example 9-5.

func Write

func Write(profileOutPath string) error

Write saves the profile of the currently open file descriptors in to file in pprof format.

Types

type File

type File struct {
	*os.File
}

File is a wrapper on os.File that tracks file descriptor lifetime.

func CreateTemp

func CreateTemp(dir, pattern string) (*File, error)

func Open

func Open(name string) (*File, error)

Open opens file and tracks it in the `fd` profile`. NOTE(bwplotka): We could use finalizers here, but explicit Close is more reliable and accurate. Unfortunately it also changes type which might be dropped accidentally.

func (*File) Close

func (f *File) Close() error

Close closes files and updates profile.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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