cockroach: Index | Files

package heapprofiler

import ""


Package Files


type HeapProfiler Uses

type HeapProfiler struct {
    // contains filtered or unexported fields

HeapProfiler is used to take heap profiles.

MaybeTakeProfile() is supposed to be called periodically. A profile is taken every time Go heap allocated bytes exceeds the previous high-water mark. The recorded high-water mark is also reset periodically, so that we take some profiles periodically. Profiles are also GCed periodically. The latest is always kept, and a couple of the ones with the largest heap are also kept.

func NewHeapProfiler Uses

func NewHeapProfiler(dir string, st *cluster.Settings) (*HeapProfiler, error)

NewHeapProfiler creates a HeapProfiler. dir is the directory in which profiles are to be stored.

func (*HeapProfiler) MaybeTakeProfile Uses

func (o *HeapProfiler) MaybeTakeProfile(ctx context.Context, ms runtime.MemStats)

MaybeTakeProfile takes a heap profile if the heap is big enough.

Package heapprofiler imports 14 packages (graph) and is imported by 5 packages. Updated 2019-08-10. Refresh now. Tools for package owners.