slowjam

module
v0.0.0-...-33ae38e Latest Latest
Warning

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

Go to latest
Published: May 24, 2020 License: Apache-2.0

README

slowjam

NOTE: This is not an officially supported Google product

SlowJam is a tool for analyzing the performance of Go applications which consume substantial wall-clock time, but do not consume substantial CPU time. For example, an automation tool which primarily waits on command-line execution or remote resources to become available.

Go has great profiling and tracing support for applications which consume many resources, but does not have a low-touch story for profiling applications that primarily wait on external resources.

Features

  • Stack-based sampling approach
  • Minimal instrumentation (2 lines of code to integrate)
  • Minimal & tunable overhead (~1% for the small workloads we have tested)
  • Hybrid Gantt/Flamegraph visualization

Screenshot

screenshot

See example/minikube.html for example output.

Requirements

  • Go v1.14 or higher

Usage

Recording

Embed this snippet into a program, preferably guarded by a flag:

s, err := stacklog.Start(stacklog.Config{})
defer s.Stop()

By default, this will poll the stack every 125ms, recording it to stack.log

Visualization

go run cmd/timeline/timeline.go </path/to/stack.log>

This will start a webserver on port 8000 with a visualization.

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

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