watchdog

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package watchdog implements a simple watchdog timer which dumps a trace of all goroutines to a file, and then ends the program, if the timer reaches its limit.

Index

Constants

View Source
const DefaultDir = "/tmp"

Variables

This section is empty.

Functions

This section is empty.

Types

type Watchdog

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

func MakeWatchdog

func MakeWatchdog(dir, prefix string, duration time.Duration, exit bool) *Watchdog

MakeWatchdog creates and starts running a watchdog timer. If <duration> passes without a reset it writes stack traces to a temporary file determined by dir, prefix. Then it exits the program if exit is set.

func (*Watchdog) Reset

func (w *Watchdog) Reset()

Reset resets the watchdog's timer to 0.

func (*Watchdog) Stop

func (w *Watchdog) Stop()

Stop stops the watchdog timer, so that it will no longer trigger.

Jump to

Keyboard shortcuts

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