diags

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Overview

Package diags contains helpers to assist in debugging and diagnostics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpAllStacks

func DumpAllStacks() string

DumpAllStacks produces a string dump of stack traces for all running goroutines.

Types

type Trigger

type Trigger func(watcher *Watcher)

Trigger is a function that is fired when a deadline is missed.

func Print

func Print(logger scribe.Logger) Trigger

Print is a trigger function that will emit a message to the given printf-style logger.

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

Watcher contains a timer that fires if an operation fails to complete within a deadline.

func Watch

func Watch(operation string, duration time.Duration, trigger Trigger) *Watcher

Watch creates a Watcher that will fire the specified trigger when the deadline specified by the duration argument expires, unless End() is called beforehand.

func (*Watcher) End

func (w *Watcher) End()

End completes the watcher, preventing the trigger from firing, unless it has already done so.

Jump to

Keyboard shortcuts

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