ezpprof

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package ezpprof is a convenience wrapper over the runtime/pprof package.

This package helps to quickly introduce profiling to a piece of code without the mess of opening files and checking errors.

A typical use of this package looks like:

ezpprof.Start("myfile.pprof")
{... some complicated code ...}
ezpprof.Stop()

Or alternatively:

const profile = true

if profile {
  ezpprof.Start("myfile.pprof")
  defer ezpprof.Stop()
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Heap

func Heap(file string)

Heap writes heap profile to the given file. Panics if an error occurs.

func Start

func Start(file string)

Start starts CPU profiling and writes to the given file. Panics if an error occurs.

func Stop

func Stop()

Stop stops CPU profiling and closes the output file. Panics if called without calling Start.

Types

This section is empty.

Jump to

Keyboard shortcuts

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