profile

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: PostgreSQL Imports: 9 Imported by: 0

Documentation

Overview

Package profile write Chrome JSON trace file

cf. https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview

Enable with Open. Produce events with Event.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

func Event

func Event() event

Event instanciates a new trace event

Returns nil if profiling is disabled.

Unless specified, event method modifies event in place and return receiver for convenience. All event methods are save to call on zero event. Use [Clone] to copy event.

func Open

func Open(path string) error

Open enables profiling

Saves events in path file as JSON array. You must ensure Close for proper profiling session end. Actually, tools accepts unterminated JSON array file for crash.

func Thread

func Thread(ctx context.Context, name string, args ...any) context.Context

Thread associate a unique thread id to context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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